Jason Henline bdc410baba [Acxxel] Remove setActiveDeviceForThread
Summary:
After experimenting with CUDA, I realized that we really only need to
set the active context right before creating an object such as a stream
or a device memory allocation. When we go on to use these objects later,
it is fine if the context that created them is no longer active,
operations with those objects will succeed anyway.

Since it turns out that we don't have to check the active context for
every operation, it makes sense to hide this active context from users
(by removing the "ActiveDeviceForThread" setter and getter) and to
change the Acxxel API to explicitly pass in the device ID to create
objects.

This change improves the Acxxel API and greatly simplifies the CUDA and
OpenCL implementations because they no longer require thread_local data.

Reviewers: jlebar, jprice

Subscribers: mgorny, parallel_libs-commits

Differential Revision: https://reviews.llvm.org/D26050

llvm-svn: 285372
2016-10-28 00:54:02 +00:00

42 lines
1014 B
CMake

add_executable(acxxel_test acxxel_test.cpp)
target_link_libraries(
acxxel_test
acxxel
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
add_test(AcxxelTest acxxel_test)
add_executable(span_test span_test.cpp)
target_link_libraries(
span_test
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
add_test(SpanTest span_test)
add_executable(status_test status_test.cpp)
target_link_libraries(
status_test
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
add_test(StatusTest status_test)
if(ACXXEL_ENABLE_OPENCL)
add_executable(opencl_test opencl_test.cpp)
target_link_libraries(
opencl_test
acxxel
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
add_test(OpenCLTest opencl_test)
endif()
if(ACXXEL_ENABLE_MULTI_DEVICE_UNIT_TESTS)
add_executable(multi_device_test multi_device_test.cpp)
target_link_libraries(
multi_device_test
acxxel
${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
add_test(MultiDeviceTest multi_device_test)
endif()