diff --git a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp index 03a2b82b8b..6612392064 100644 --- a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp +++ b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 * TEST: %t * HIT_END */ @@ -127,10 +127,16 @@ struct joinable_thread : std::thread void run_multi_threads(uint32_t n) { std::vector mf(n); { + hipDevice_t device; + HIPCHECK(hipDeviceGet(&device, 0)); + auto buffer = load_file(); std::vector threads; for (uint32_t i = 0; i < n; i++) { threads.emplace_back(std::thread{[&, i, buffer] { + hipCtx_t ctx; + HIPCHECK(hipDevicePrimaryCtxRetain(&ctx, device)); + mf[i] = load(buffer); }}); }