DPC++ Runtime
Runtime libraries for oneAPI DPC++
grf_size_properties.hpp
Go to the documentation of this file.
1 //==- grf_size_properties.hpp - GRF size kernel properties for Intel GPUs -==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===--------------------------------------------------------------------===//
8 
9 #pragma once
10 
15 
16 #define SYCL_EXT_INTEL_GRF_SIZE 1
17 
18 namespace sycl {
19 inline namespace _V1 {
20 namespace ext::intel::experimental {
22  oneapi::experimental::detail::PropKind::GRFSize> {
23  template <unsigned int Size>
25  grf_size_key, std::integral_constant<unsigned int, Size>>;
26 };
27 
30  oneapi::experimental::detail::PropKind::GRFSizeAutomatic> {
32 };
33 
34 template <unsigned int Size>
36 
38 
39 } // namespace ext::intel::experimental
40 namespace ext::oneapi::experimental::detail {
41 template <unsigned int Size>
44  static_assert(Size == 128 || Size == 256, "Unsupported GRF size");
45  static constexpr const char *name = "sycl-grf-size";
46  static constexpr unsigned int value = Size;
47 };
48 template <>
51  static constexpr const char *name = "sycl-grf-size";
52  static constexpr unsigned int value = 0;
53 };
54 
55 template <typename Properties>
56 struct ConflictingProperties<sycl::ext::intel::experimental::grf_size_key,
57  Properties>
58  : std::bool_constant<
59  ContainsProperty<
60  sycl::ext::intel::experimental::grf_size_automatic_key,
61  Properties>::value ||
62  ContainsProperty<sycl::detail::register_alloc_mode_key,
63  Properties>::value> {};
64 
65 template <typename Properties>
66 struct ConflictingProperties<
68  : std::bool_constant<
69  ContainsProperty<sycl::ext::intel::experimental::grf_size_key,
70  Properties>::value ||
71  ContainsProperty<sycl::detail::register_alloc_mode_key,
72  Properties>::value> {};
73 
74 template <typename Properties>
75 struct ConflictingProperties<sycl::detail::register_alloc_mode_key, Properties>
76  : std::bool_constant<
77  ContainsProperty<sycl::ext::intel::experimental::grf_size_key,
78  Properties>::value ||
79  ContainsProperty<
80  sycl::ext::intel::experimental::grf_size_automatic_key,
81  Properties>::value> {};
82 
83 } // namespace ext::oneapi::experimental::detail
84 } // namespace _V1
85 } // namespace sycl
constexpr grf_size_key::value_t< Size > grf_size
constexpr grf_size_automatic_key::value_t grf_size_automatic
Definition: access.hpp:18