[Parallel_libs-commits] [PATCH] D26050: [Acxxel] Remove setActiveDeviceForThread

Jason Henline via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Thu Oct 27 16:51:25 PDT 2016


jhen created this revision.
jhen added reviewers: jlebar, jprice.
jhen added a subscriber: parallel_libs-commits.
Herald added a subscriber: mgorny.

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.


https://reviews.llvm.org/D26050

Files:
  acxxel/CMakeLists.txt
  acxxel/acxxel.h
  acxxel/cuda_acxxel.cpp
  acxxel/opencl_acxxel.cpp
  acxxel/tests/CMakeLists.txt
  acxxel/tests/acxxel_test.cpp
  acxxel/tests/multi_device_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26050.76133.patch
Type: text/x-patch
Size: 35443 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/parallel_libs-commits/attachments/20161027/0705f498/attachment-0001.bin>


More information about the Parallel_libs-commits mailing list