From 0201f6f1c9229efff918473cd9b3077a8742bd6a Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Thu, 7 Nov 2024 10:02:26 -0800 Subject: [PATCH 1/3] Add accessor static members to retrieve template arguments --- adoc/headers/accessorBuffer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adoc/headers/accessorBuffer.h b/adoc/headers/accessorBuffer.h index 69cc52045..f8447fda1 100644 --- a/adoc/headers/accessorBuffer.h +++ b/adoc/headers/accessorBuffer.h @@ -31,6 +31,10 @@ template class accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + static constexpr target access_target = AccessTarget; + using value_type = // const DataT for read-only accessors, DataT otherwise __value_type__; using reference = value_type&; From 7c159671a7a082725fe338a0b131e7729446c1ba Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Mon, 20 Oct 2025 14:02:13 -0700 Subject: [PATCH 2/3] Add the same members for other accessor types --- adoc/headers/accessorHost.h | 3 +++ adoc/headers/accessorLocal.h | 2 ++ adoc/headers/accessorSampledImage.h | 5 +++++ adoc/headers/accessorUnsampledImage.h | 7 +++++++ 4 files changed, 17 insertions(+) diff --git a/adoc/headers/accessorHost.h b/adoc/headers/accessorHost.h index 736c0200d..582c1b269 100644 --- a/adoc/headers/accessorHost.h +++ b/adoc/headers/accessorHost.h @@ -8,6 +8,9 @@ template class host_accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + using value_type = // const DataT for read-only accessors, DataT otherwise __value_type__; using reference = value_type&; diff --git a/adoc/headers/accessorLocal.h b/adoc/headers/accessorLocal.h index 4349a8a9f..b554e5aec 100644 --- a/adoc/headers/accessorLocal.h +++ b/adoc/headers/accessorLocal.h @@ -4,6 +4,8 @@ namespace sycl { template class local_accessor { public: + static constexpr int dimensions = Dimensions; + using value_type = DataT; using reference = value_type&; using const_reference = const DataT&; diff --git a/adoc/headers/accessorSampledImage.h b/adoc/headers/accessorSampledImage.h index 5bca269b4..c0c2bf947 100644 --- a/adoc/headers/accessorSampledImage.h +++ b/adoc/headers/accessorSampledImage.h @@ -9,6 +9,9 @@ template class sampled_image_accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr image_target access_target = AccessTarget; + using value_type = const DataT; using reference = const DataT&; using const_reference = const DataT&; @@ -33,6 +36,8 @@ class sampled_image_accessor { template class host_sampled_image_accessor { public: + static constexpr int dimensions = Dimensions; + using value_type = const DataT; using reference = const DataT&; using const_reference = const DataT&; diff --git a/adoc/headers/accessorUnsampledImage.h b/adoc/headers/accessorUnsampledImage.h index 586c8cda4..5392063ed 100644 --- a/adoc/headers/accessorUnsampledImage.h +++ b/adoc/headers/accessorUnsampledImage.h @@ -9,6 +9,10 @@ template class unsampled_image_accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + static constexpr image_target access_target = AccessTarget; + using value_type = // const DataT for read-only accessors, DataT otherwise __value_type__; using reference = value_type&; @@ -45,6 +49,9 @@ template class host_unsampled_image_accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + using value_type = // const DataT for read-only accessors, DataT otherwise __value_type__; using reference = value_type&; From 7622da01a3d903fbf84e6e531d1645d29671422a Mon Sep 17 00:00:00 2001 From: Lorenc Bushi Date: Mon, 2 Feb 2026 11:04:48 -0800 Subject: [PATCH 3/3] Add accessor template arguments as members for deprecated accessor specializations --- adoc/headers/accessorDeprecatedConstant.h | 4 ++++ adoc/headers/accessorDeprecatedHost.h | 4 ++++ adoc/headers/accessorDeprecatedLocal.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/adoc/headers/accessorDeprecatedConstant.h b/adoc/headers/accessorDeprecatedConstant.h index 24746954a..d94b30bc1 100644 --- a/adoc/headers/accessorDeprecatedConstant.h +++ b/adoc/headers/accessorDeprecatedConstant.h @@ -7,6 +7,10 @@ template class accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + static constexpr target access_target = AccessTarget; + using value_type = const DataT; using reference = const DataT&; using const_reference = const DataT&; diff --git a/adoc/headers/accessorDeprecatedHost.h b/adoc/headers/accessorDeprecatedHost.h index 09e46f817..1f1bfc6e9 100644 --- a/adoc/headers/accessorDeprecatedHost.h +++ b/adoc/headers/accessorDeprecatedHost.h @@ -7,6 +7,10 @@ template class accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + static constexpr target access_target = AccessTarget; + using value_type = // const DataT for access_mode::read, DataT otherwise __value_type__; using reference = value_type&; diff --git a/adoc/headers/accessorDeprecatedLocal.h b/adoc/headers/accessorDeprecatedLocal.h index 2f67d833a..f1222fe2f 100644 --- a/adoc/headers/accessorDeprecatedLocal.h +++ b/adoc/headers/accessorDeprecatedLocal.h @@ -7,6 +7,10 @@ template class accessor { public: + static constexpr int dimensions = Dimensions; + static constexpr sycl::access_mode access_mode = AccessMode; + static constexpr target access_target = AccessTarget; + using value_type = DataT; using reference = DataT&; using const_reference = const DataT&;