[Acxxel] Remove setActiveDeviceForThread

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

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
GitOrigin-RevId: bdc410babaee93aad9e7b582e49ba35a774e3825
7 files changed
tree: 32931290b7fc470200aaded4d346650521a6eb54
  1. .arcconfig
  2. .clang-format
  3. .clang-tidy
  4. CMakeLists.txt
  5. README.rst
  6. acxxel/