Skip to content

Commit 70f92a0

Browse files
authored
[compat] Remove usage of __SYCL_COMPILER_VERSION (#16812)
There should be no logic based on the compiler version within the actual compiler: it can only have one version. Note: does not take into account time-travel :) Signed-off-by: JackAKirk <[email protected]>
1 parent 11a73e7 commit 70f92a0

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

sycl/include/syclcompat/device.hpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ class device_ext : public sycl::device {
450450
/// \param [out] total_memory The number of bytes of total memory on the SYCL
451451
/// device.
452452
void get_memory_info(size_t &free_memory, size_t &total_memory) const {
453-
#if (defined(__SYCL_COMPILER_VERSION) && __SYCL_COMPILER_VERSION >= 20221105)
454453
if (!has(sycl::aspect::ext_intel_free_memory)) {
455454
std::cerr << "[SYCLCompat] get_memory_info: ext_intel_free_memory is not "
456455
"supported."
@@ -459,17 +458,6 @@ class device_ext : public sycl::device {
459458
} else {
460459
free_memory = get_info<sycl::ext::intel::info::device::free_memory>();
461460
}
462-
#else
463-
std::cerr << "[SYCLCompat] get_memory_info: ext_intel_free_memory is not "
464-
"supported."
465-
<< std::endl;
466-
free_memory = 0;
467-
#if defined(_MSC_VER) && !defined(__clang__)
468-
#pragma message("Querying the number of bytes of free memory is not supported")
469-
#else
470-
#warning "Querying the number of bytes of free memory is not supported"
471-
#endif
472-
#endif
473461
total_memory = get_device_info().get_global_mem_size();
474462
}
475463

@@ -489,15 +477,10 @@ class device_ext : public sycl::device {
489477
prop.set_minor_version(minor);
490478

491479
prop.set_max_work_item_sizes(
492-
#if (__SYCL_COMPILER_VERSION && __SYCL_COMPILER_VERSION < 20220902)
493-
// oneAPI DPC++ compiler older than 2022/09/02, where
494-
// max_work_item_sizes is an enum class element
495-
get_info<sycl::info::device::max_work_item_sizes>());
496-
#else
497480
// SYCL 2020-conformant code, max_work_item_sizes is a struct
498481
// templated by an int
499482
get_info<sycl::info::device::max_work_item_sizes<3>>());
500-
#endif
483+
501484
prop.set_host_unified_memory(has(sycl::aspect::usm_host_allocations));
502485

503486
prop.set_max_clock_frequency(

0 commit comments

Comments
 (0)