-
Notifications
You must be signed in to change notification settings - Fork 850
[SYCL] Implement sycl_ext_intel_maximum_registers #22923
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
base: sycl
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11288,7 +11288,8 @@ static void getTripleBasedSPIRVTransOpts(Compilation &C, | |
| ",+SPV_KHR_cooperative_matrix" | ||
| ",+SPV_EXT_shader_atomic_float16_add" | ||
| ",+SPV_INTEL_fp_max_error" | ||
| ",+SPV_INTEL_memory_access_aliasing"; | ||
| ",+SPV_INTEL_memory_access_aliasing" | ||
| ",+SPV_INTEL_maximum_registers"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should an equivalent entry be done for the new model in https://github.com/sarnex/llvm/blob/457e4b4ef0ed66fd9c4ceb5b47a55860828c2459/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp#L954
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah good catch, i incorrectly assumed the driver one was used for both. fixed in b403905, thanks |
||
|
|
||
| TranslatorArgs.push_back(TCArgs.MakeArgString(ExtArg)); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| //==---------------- maximum_registers_properties.hpp --------------------==// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===--------------------------------------------------------------------===// | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <sycl/ext/oneapi/free_function_kernel_properties.hpp> | ||
| #include <sycl/ext/oneapi/properties.hpp> | ||
| #include <sycl/ext/oneapi/properties/property.hpp> | ||
| #include <sycl/ext/oneapi/properties/property_value.hpp> | ||
|
|
||
| #define SYCL_EXT_INTEL_MAXIMUM_REGISTERS 1 | ||
|
|
||
| namespace sycl { | ||
| inline namespace _V1 { | ||
| namespace ext::intel::experimental { | ||
| struct maximum_registers_key | ||
| : oneapi::experimental::detail::compile_time_property_key< | ||
| oneapi::experimental::detail::PropKind::MaximumRegisters> { | ||
| template <unsigned int Size> | ||
| using value_t = oneapi::experimental::property_value< | ||
| maximum_registers_key, std::integral_constant<unsigned int, Size>>; | ||
| }; | ||
|
|
||
| struct maximum_registers_automatic_key | ||
| : oneapi::experimental::detail::compile_time_property_key< | ||
| oneapi::experimental::detail::PropKind::MaximumRegistersAutomatic> { | ||
| using value_t = | ||
| oneapi::experimental::property_value<maximum_registers_automatic_key>; | ||
| }; | ||
|
|
||
| template <unsigned int Size> | ||
| inline constexpr maximum_registers_key::value_t<Size> maximum_registers; | ||
|
|
||
| inline constexpr maximum_registers_automatic_key::value_t | ||
| maximum_registers_automatic; | ||
|
|
||
| } // namespace ext::intel::experimental | ||
| namespace ext::oneapi::experimental::detail { | ||
| template <unsigned int Size> | ||
| struct PropertyMetaInfo< | ||
| sycl::ext::intel::experimental::maximum_registers_key::value_t<Size>> { | ||
| static_assert(Size == 128 || Size == 256 || Size == 512, | ||
| "Unsupported maximum registers"); | ||
| static constexpr const char *name = "sycl-maximum-registers"; | ||
| static constexpr unsigned int value = Size; | ||
| }; | ||
| template <> | ||
| struct PropertyMetaInfo< | ||
| sycl::ext::intel::experimental::maximum_registers_automatic_key::value_t> { | ||
| static constexpr const char *name = "sycl-maximum-registers"; | ||
| static constexpr unsigned int value = 0; | ||
| }; | ||
|
|
||
| } // namespace ext::oneapi::experimental::detail | ||
| } // namespace _V1 | ||
| } // namespace sycl |
Uh oh!
There was an error while loading. Please reload this page.
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.
This will not cause an issue for older graphics drivers. The only way to generate a SPIR-V module that actually uses this extension is to use the new SYCL property implemented in this PR.