diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index ecb8c9369dcc0..e56f1977b5bfb 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -13,7 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") include(AddSYCLExecutable) set(SYCL_MAJOR_VERSION 5) -set(SYCL_MINOR_VERSION 3) +set(SYCL_MINOR_VERSION 4) set(SYCL_PATCH_VERSION 0) set(SYCL_DEV_ABI_VERSION 0) if (SYCL_ADD_DEV_VERSION_POSTFIX) diff --git a/sycl/include/CL/sycl/aspects.hpp b/sycl/include/CL/sycl/aspects.hpp index 80be943383fc1..f1ef65337a817 100644 --- a/sycl/include/CL/sycl/aspects.hpp +++ b/sycl/include/CL/sycl/aspects.hpp @@ -46,6 +46,7 @@ enum class aspect { atomic64 = 28, ext_intel_device_info_uuid = 29, ext_oneapi_srgb = 30, + ext_intel_bf16_conversion = 31, }; } // namespace sycl diff --git a/sycl/include/CL/sycl/info/device_traits.def b/sycl/include/CL/sycl/info/device_traits.def index 208d06f8b31ca..91f9d49bfedd4 100644 --- a/sycl/include/CL/sycl/info/device_traits.def +++ b/sycl/include/CL/sycl/info/device_traits.def @@ -98,3 +98,4 @@ __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_max_mem_bandwidth, pi_uint64) __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_mem_channel, bool) __SYCL_PARAM_TRAITS_SPEC(device, ext_oneapi_srgb, bool) __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_device_info_uuid, detail::uuid_type) +__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_bf16_conversion, bool) diff --git a/sycl/include/CL/sycl/info/info_desc.hpp b/sycl/include/CL/sycl/info/info_desc.hpp index 2e7ad37c7547d..e029fa618c324 100644 --- a/sycl/include/CL/sycl/info/info_desc.hpp +++ b/sycl/include/CL/sycl/info/info_desc.hpp @@ -154,6 +154,7 @@ enum class device : cl_device_info { atomic64 = PI_DEVICE_INFO_ATOMIC_64, atomic_memory_order_capabilities = PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, + ext_intel_bf16_conversion, }; enum class device_type : pi_uint64 { diff --git a/sycl/source/detail/device_info.hpp b/sycl/source/detail/device_info.hpp index 718a0919f906a..a286b989eea0e 100644 --- a/sycl/source/detail/device_info.hpp +++ b/sycl/source/detail/device_info.hpp @@ -493,6 +493,23 @@ template <> struct get_device_info { } }; +// Specialization for bfloat16 +template <> +struct get_device_info { + static bool get(RT::PiDevice dev, const plugin &Plugin) { + // TODO: We claim, that all Intel GPU devices support bfloat16 conversion + // feature but we'd better have a low-level extension to query for support + // of the feature + platform plt = + get_device_info::get(dev, Plugin); + std::string platform_name = plt.get_info(); + if (platform_name == "Intel(R) OpenCL HD Graphics") + return true; + + return false; + } +}; + // SYCL host device information // Default template is disabled, all possible instantiations are @@ -998,6 +1015,11 @@ inline bool get_device_info_host() { return false; } +template <> +inline bool get_device_info_host() { + return false; +} + cl_uint get_native_vector_width(size_t idx); // USM diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 56bda0b5e7a6b..edeb00e89da86 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -4173,6 +4173,7 @@ _ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65574EEENS3_12param_traitsIS4_XT_ _ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65575EEENS3_12param_traitsIS4_XT_EE11return_typeEv _ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65808EEENS3_12param_traitsIS4_XT_EE11return_typeEv _ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65809EEENS3_12param_traitsIS4_XT_EE11return_typeEv +_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65810EEENS3_12param_traitsIS4_XT_EE11return_typeEv _ZNK2cl4sycl6device9getNativeEv _ZNK2cl4sycl6kernel11get_contextEv _ZNK2cl4sycl6kernel11get_programEv diff --git a/sycl/test/on-device/basic_tests/aspects.cpp b/sycl/test/on-device/basic_tests/aspects.cpp index 37961815f392d..febdbcd70fc76 100644 --- a/sycl/test/on-device/basic_tests/aspects.cpp +++ b/sycl/test/on-device/basic_tests/aspects.cpp @@ -96,6 +96,9 @@ int main() { if (plt.has(aspect::usm_system_allocations)) { std::cout << " USM system allocations" << std::endl; } + if (plt.has(aspect::ext_intel_bf16_conversion)) { + std::cout << " BFloat16 conversion extension" << std::endl; + } } std::cout << "Passed." << std::endl; return 0;