Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor cl::sycl::info::device_type to allow bitwise operations internally #1247

Open
sergey-semenov opened this issue Mar 4, 2020 · 2 comments
Labels
confirmed enhancement New feature or request good first issue Good for newcomers

Comments

@sergey-semenov
Copy link
Contributor

Current underlying values of cl::sycl::info::device_type do not lend themselves for bitwise operations.

enum class device_type : pi_uint64 {
  cpu         = PI_DEVICE_TYPE_CPU,
  gpu         = PI_DEVICE_TYPE_GPU,
  accelerator = PI_DEVICE_TYPE_ACC,
  // TODO: figure out if we need all the below in PI
  custom      = CL_DEVICE_TYPE_CUSTOM,
  automatic,
  host,
  all         = CL_DEVICE_TYPE_ALL
};

This leads to some unnecessarily complex logic of cl::sycl::detail::match_types and cl::sycl::detail::force_types, which could be merged into a single simpler method.

@bader bader added the good first issue Good for newcomers label Mar 4, 2020
@mkinsner
Copy link

mkinsner commented Mar 4, 2020

There is a wider issue, in that an OpenCL device can identify as more than one of these types (in a bitfield way):

In OpenCL, device types are a bitfield and not mutually exclusive.

device_type is a bitfield that identifies the type of OpenCL device.

In SYCL 1.2.1, device_type is an enum:

enum class device_type : unsigned int {

So the bitfield representation should probably be exposed through SYCL, and not just an internal implementation detail.

A proposal here or in the SYCL 1.2.1 spec repo to fix this, would be well received. There are simple solutions.

@keryell
Copy link
Contributor

keryell commented Mar 10, 2020

@github-actions github-actions bot added the Stale label Feb 19, 2022
@intel intel deleted a comment from github-actions bot Mar 2, 2022
@AlexeySachkov AlexeySachkov added enhancement New feature or request and removed Stale labels Mar 2, 2022
@AlexeySachkov AlexeySachkov self-assigned this Mar 2, 2022
@AlexeySachkov AlexeySachkov removed their assignment Mar 2, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
confirmed enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants