lukeiwanski / tensorflow

OpenCL support for TensorFlow via SYCL
Apache License 2.0
65 stars 14 forks source link

Add SYCL device selection #174

Closed Rbiessy closed 6 years ago

Rbiessy commented 7 years ago

This will simply change the order the SYCL devices are added. By default TF will still use the first device added.

With these changes the devices are added in the following order:

  1. if the environment variable TENSORFLOW_SYCL_USE_PLATFORM_NAME_VENDOR_ID is set to :, this specific device will be added. It is useful if there are multiple similar platforms or similar devices
  2. if the environment variable TENSORFLOW_SYCL_USE_DEVICE_TYPE is set to gpu, cpu or acc, the first device of the specified type will be added. It should only be used if there is one device of the given type
  3. add all gpus (in non-deterministic order)
  4. add all accelerators (in non-deterministic order)
  5. add all cpus (in non-deterministic order)
Rbiessy commented 6 years ago

This can be closed, Eigen has a good enough workaround to avoid that now. I'll keep the changes in my branch just in case but I'm closing the PR.