Skip to content

DPC++ does not support all aspects from SYCL 2020 #309

Closed

Description

@1e-to

The list of aspects that don't supported in actual way.

  • emulated
  • host_debuggable
  • atomic64
  • usm_atomic_host_allocations
  • usm_atomic_shared_allocations
  • usm_system_allocations

Activity

  1. oleksandr-pavlyk commented on May 21, 2021

    @oleksandr-pavlyk
    Contributor

    The following C++ code

    #include <CL/sycl.hpp>
    #include <iostream>
    
    int main(void) {
        sycl::device d {};
    
        sycl::vector_class<sycl::aspect> asps = {
            sycl::aspect::emulated,
            sycl::aspect::host_debuggable,
            sycl::aspect::atomic64,
            sycl::aspect::usm_atomic_host_allocations,
            sycl::aspect::usm_atomic_shared_allocations,
            sycl::aspect::usm_system_allocations
        };
    
        int i = 0;
        for (const auto &a : asps) {
            if (d.has(a)) {
                std::cout << "Device has aspect " << i << std::endl;
            } else {
                std::cout << "Device does NOT have aspect " << i << std::endl;
            }
            ++i;
        }
    
        return 0;
    }

    still errors out on each of these aspects using intel/llvm DPC++ toolchain.

  2. oleksandr-pavlyk commented on Jul 20, 2021

    @oleksandr-pavlyk
    Contributor

    Still the case in oneAPI 2020.3

  3. changed the title [-]DPC++ does not support any aspects from SYCL 2020[/-] [+]DPC++ does not support all aspects from SYCL 2020[/+] on Sep 23, 2021
  4. oleksandr-pavlyk commented on Feb 2, 2022

    @oleksandr-pavlyk
    Contributor

    Some of these are now implemented in 2022.0 DPC++: https://github.com/intel/llvm/blob/bd68232bb96386bf7649345c0557ba520e73c02d/sycl/include/CL/sycl/aspects.hpp

    Specifically:

    atomic64
    usm_atomic_host_allocations
    usm_atomic_shared_allocations
    usm_system_allocations

    These will need to be added to dpctl.

  5. oleksandr-pavlyk commented on May 21, 2024

    @oleksandr-pavlyk
    Contributor

    All listed aspects are not supported by DPC++ as of version 2024.1.0 .

    The updated program

    ``cpp
    #include <CL/sycl.hpp>
    #include
    #include
    #include

    int main(void) {
    sycl::device d {};
    const auto &name = d.get_infosycl::info::device::name();
    const auto &dver = d.get_infosycl::info::device::driver_version();

    std::cout << "Device: " << name << " [" << dver << "]" << std::endl;
    
    std::vector<sycl::aspect> asps = {
        sycl::aspect::emulated,
        sycl::aspect::host_debuggable,
        sycl::aspect::atomic64,
        sycl::aspect::usm_atomic_host_allocations,
        sycl::aspect::usm_atomic_shared_allocations,
        sycl::aspect::usm_system_allocations
    };
    
    int i = 0;
    for (const auto &a : asps) {
        if (d.has(a)) {
            std::cout << "Device has aspect " << i << std::endl;
        } else {
            std::cout << "Device does NOT have aspect " << i << std::endl;
        }
        ++i;
    }
    
    return 0;
    

    }

    
    compiles with `icpx -fsycl asp.cpp -o asp` and outputs
    
    

    (dev_dpctl) opavlyk@opavlyk-mobl:~/tmp$ ./asp
    Device: Intel(R) Graphics [0x9a49] [1.3.29138]
    Device does NOT have aspect 0
    Device does NOT have aspect 1
    Device has aspect 2
    Device does NOT have aspect 3
    Device does NOT have aspect 4
    Device does NOT have aspect 5

    
    The `dpctl.SyclDevice` only does not support querying the "emulated" aspect, to be added in 0.18 release.
    
    Closing this issue.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions