diff --git a/samples/hipMultiThreadAddCallback/hipMultiThreadAddCallback.cc b/samples/hipMultiThreadAddCallback/hipMultiThreadAddCallback.cc index 42ab35763..16f6caec0 100644 --- a/samples/hipMultiThreadAddCallback/hipMultiThreadAddCallback.cc +++ b/samples/hipMultiThreadAddCallback/hipMultiThreadAddCallback.cc @@ -41,7 +41,7 @@ multiple Threads. #endif static constexpr size_t N = 4096; -static constexpr int numThreads = 3; +static constexpr int numThreads = 1000; static std::atomic Cb_count{0}, Data_mismatch{0}; static hipStream_t mystream; static float *A1_h, *C1_h; @@ -85,7 +85,6 @@ static void HIPRT_CB Thread1_Callback(hipStream_t stream, hipError_t status, // Increment the Cb_count to indicate that the callback is processed. ++Cb_count; - std::cout << "Hello from thread id: " << std::this_thread::get_id() << "\n"; } static void HIPRT_CB Thread2_Callback(hipStream_t stream, hipError_t status, @@ -103,8 +102,6 @@ static void HIPRT_CB Thread2_Callback(hipStream_t stream, hipError_t status, // Increment the Cb_count to indicate that the callback is processed. ++Cb_count; - // hello from thread id - std::cout << "Hello from thread id: " << std::this_thread::get_id() << "\n"; } void Thread1_func() { diff --git a/src/CHIPBackend.hh b/src/CHIPBackend.hh index 7a1e01f5c..2c17bad41 100644 --- a/src/CHIPBackend.hh +++ b/src/CHIPBackend.hh @@ -1286,7 +1286,7 @@ protected: public: // atomic int for counting number of threads that were created // for this device - std::atomic NumThreadsAlive; + std::atomic NumThreadsAlive = 0; hipDeviceProp_t getDeviceProps() { return HipDeviceProps_; } std::mutex DeviceVarMtx; diff --git a/src/backend/Level0/CHIPBackendLevel0.cc b/src/backend/Level0/CHIPBackendLevel0.cc index 92790fc0b..ad9e7a23c 100644 --- a/src/backend/Level0/CHIPBackendLevel0.cc +++ b/src/backend/Level0/CHIPBackendLevel0.cc @@ -1663,8 +1663,9 @@ chipstar::ExecItem *CHIPBackendLevel0::createExecItem(dim3 GirdDim, return ExecItem; }; -std::shared_ptr CHIPBackendLevel0::createEventShared( - chipstar::Context *ChipCtx, chipstar::EventFlags Flags) { +std::shared_ptr +CHIPBackendLevel0::createEventShared(chipstar::Context *ChipCtx, + chipstar::EventFlags Flags) { std::shared_ptr Event; auto ZeCtx = (CHIPContextLevel0 *)ChipCtx;