-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Rename cuda, hip and fix renaming for level_zero backends #4785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
please do renaming in https://github.com/intel/llvm-test-suite/ as well. |
@bader Alexey what about namespaces? I see there are namespaces containing the "cuda" word: |
@vladimirlaz I've opened a PR with renamings: intel/llvm-test-suite#521 But as I understand, the tests will pass only after merging this PR. |
I was under impression that SYCL 2020 spec doesn't require additional extensions to implement it on top of non-OpenCL API. So this statement sounds surprising. |
If there are properties that are specific to the CUDA backend, the extension naming guideline would put them in the |
This properties are in the namespace sycl {
namespace property {
namespace context {
namespace cuda {
class use_primary_context
: public detail::DataLessProperty<detail::UsePrimaryContext> {};
} // namespace cuda
} // namespace context
} // namespace property
} // namespace sycl
} // __SYCL_INLINE_NAMESPACE(cl) So, there are cuda-related properties only. Should the The second file is in a bit different situation: there are a cuda-related property as well as some generic ones: __SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {
namespace property {
namespace queue {
class in_order : public detail::DataLessProperty<detail::InOrder> {};
class enable_profiling
: public detail::DataLessProperty<detail::QueueEnableProfiling> {};
namespace cuda {
class use_default_stream
: public detail::DataLessProperty<detail::UseDefaultStream> {};
} // namespace cuda
} // namespace queue
} // namespace property
} // namespace sycl
} // __SYCL_INLINE_NAMESPACE(cl) But the question is the same. In which namespace the Thank you. P.S. Hmm, as I see in the |
Yes, this is the pattern to follow:
|
According to SYCL spec, backend::cuda is renamed to backend::ext_oneapi_cuda, backend::hip is renamed to backend::ext_oneapi_hip. Old namings were marked as deprecated. The renaming is also applied in the sources, tests and unit-tests. Renaming for the level_zero backend is also applied for the sources, tests and unit-tests.
…d/cuda.hpp According to SYCL spec, an extension may define new header files under the "sycl" path. The path prefix "sycl/ext/<vendorstring>" is reserved for this purpose. The "CL/sycl/backend/cuda.hpp" file is moved into the "sycl/ext/oneapi/backend/cuda.hpp" one. The old file is marked as deprecated.
…namespace The class 'use_default_stream' has been moved from the non SYCL2020-conforming namespace 'sycl::property::queue::cuda' into the 'sycl::ext::oneapi::cuda::property::queue' one where the namespace 'sycl::ext::oneapi::cuda' is reserved for new backends. Also, the class 'use_primary_context' has been moved from the 'sycl::property::context::cuda' namespace into the 'sycl::ext::oneapi::cuda::property:context' one.
There are new symbols in the new library. It is a non-breaking change.
There are new symbols in the new library. It is a non-breaking change.
There are new symbols in the new library. It is a non-breaking change.
When the old cuda backend header (CL/sycl/backend/cuda.hpp) is included, a deprecation warning is generated. When "to trait warning as errors" compilation flag is enabled, the warning leads to a compilation error. The new path to the cuda backend header (sycl/ext/oneapi/backend/cuda.hpp) must be used to avoid the error.
The same sets for the level_zero backend are already marked as deprecated so this is good idea to align the opencl backend with them.
The sycl::interop class template and all its specializations have been moved to the sycl::detail namespace. The class template is not a part of the sycl-API and we should not extend the API in headers except the ones in the sycl/ext/<vendorstring>/... directories. The sycl::detail::interop part of the opencl and level_zero backends were moven into the new introduced detail/backend_traits_opencl.hpp and detail/backend_traits_level_zero.hpp headers as well as the whole sycl/ext/oneapi/backend/cuda.hpp file were renamed into the detail/backend_traits_cuda.hpp one since there is no API extensions in the CUDA backend.
# Conflicts: # sycl/source/backend.cpp
@vladimirlaz @gmlueck @AerialMantis @bader @againull @smaslov-intel The PR is ready for review. Could you check, please? I've updated on the current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@steffenlarsen Could you review the renaming of properties for CUDA as well?
Absolutely! LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PI and Level Zero part LGTM.
Co-authored-by: Greg Lueck <[email protected]>
ae5780b
According to SYCL spec,
backend::cuda
was renamed tobackend::ext_oneapi_cuda
,and
backend::hip
was renamed tobackend::ext_oneapi_hip
. Old names weremarked as deprecated. The renaming is also applied in the sources, tests and
unit-tests. Renaming for the Level Zero backend was also applied for the sources,
tests and unit-tests.
The following properties were moved into namespaces reserved for extensions:
The
interop
class template was re-defined in thesycl::detail
namespace sinceit is not an extension of the SYCL API but just an implementation detail. The parts
of
CL/sycl/backend/opencl.hpp
that contain specializations for thesycl::detail::interop
class template were moved into the new createdCL/sycl/detail/backend_traits_opencl.hpp
header, as well as the same parts of thesycl/ext/oneapi/backend/level_zero.hpp
header. The wholeCL/sycl/backend/cuda.hpp
header file was also renamed into theCL/sycl/detail/backend_traits_cuda.hpp
one since the file contains a number ofsycl::detail::interop
class template specializations only. A warning was added intothe old file.