diff --git a/runtime/threadPool/src/x86/api.cpp b/runtime/threadPool/src/x86/api.cpp index 0095b37..ad34b36 100644 --- a/runtime/threadPool/src/x86/api.cpp +++ b/runtime/threadPool/src/x86/api.cpp @@ -8,11 +8,6 @@ #include #include -/* - - -*/ - /* Initialize the device */ @@ -112,6 +107,9 @@ int schedulerEnqueueKernel(cu_kernel *k) { Kernel Launch with numBlocks and numThreadsPerBlock */ int cuLaunchKernel(cu_kernel **k) { + if (!device_initilized) { + init_device(); + } // Calculate Block Size N/numBlocks cu_kernel *ker = *k; int status = C_RUN; @@ -239,7 +237,7 @@ void cuSynchronizeBarrier() { init_device(); } while (1) { - // (TODO): currently, we assume each kernel launch will have a + // (TODO): currently, we assume each kernel launch has a // following sync if (scheduler->kernelQueue->size_approx() == 0) { int completeBlock = 0;