@@ -681,17 +681,18 @@ class device_info {
681
681
public:
682
682
const char *get_name();
683
683
char *get_name();
684
- template <typename WorkItemSizesTy = sycl::id <3>,
684
+ template <typename WorkItemSizesTy = sycl::range <3>,
685
685
std::enable_if_t<std::is_same_v<WorkItemSizesTy, sycl::id<3>> ||
686
686
std::is_same_v<WorkItemSizesTy, int *>,
687
687
int> = 0>
688
688
auto get_max_work_item_sizes() const;
689
689
690
- template <typename WorkItemSizesTy = sycl::id <3>,
690
+ template <typename WorkItemSizesTy = sycl::range <3>,
691
691
std::enable_if_t<std::is_same_v<WorkItemSizesTy, sycl::id<3>> ||
692
692
std::is_same_v<WorkItemSizesTy, int *>,
693
693
int> = 0>
694
694
auto get_max_work_item_sizes() const;
695
+ bool get_host_unified_memory() const;
695
696
int get_major_version() const;
696
697
int get_minor_version() const;
697
698
int get_integrated() const;
@@ -700,6 +701,7 @@ public:
700
701
int get_max_work_group_size() const;
701
702
int get_max_sub_group_size() const;
702
703
int get_max_work_items_per_compute_unit() const;
704
+ int get_max_register_size_per_work_group() const;
703
705
template <typename NDRangeSizeTy = size_t *,
704
706
std::enable_if_t<std::is_same_v<NDRangeSizeTy, size_t *> ||
705
707
std::is_same_v<NDRangeSizeTy, int *>,
@@ -713,8 +715,17 @@ public:
713
715
size_t get_global_mem_size() const;
714
716
size_t get_local_mem_size() const;
715
717
716
- void set_name(const char *name);
717
- void set_max_work_item_sizes(const sycl::id<3> max_work_item_sizes);
718
+ unsigned int get_memory_clock_rate() const;
719
+ unsigned int get_memory_bus_width() const;
720
+ uint32_t get_device_id() const;
721
+ std::array<unsigned char, 16> get_uuid() const;
722
+ unsigned int get_global_mem_cache_size() const;
723
+
724
+ void set_name(const char *name);
725
+ void set_max_work_item_sizes(const sycl::range<3> max_work_item_sizes);
726
+ [[deprecated]] void
727
+ set_max_work_item_sizes(const sycl::id<3> max_work_item_sizes);
728
+ void set_host_unified_memory(bool host_unified_memory);
718
729
void set_major_version(int major);
719
730
void set_minor_version(int minor);
720
731
void set_integrated(int integrated);
@@ -727,6 +738,13 @@ void set_name(const char *name);
727
738
void
728
739
set_max_work_items_per_compute_unit(int max_work_items_per_compute_unit);
729
740
void set_max_nd_range_size(int max_nd_range_size[]);
741
+ void set_memory_clock_rate(unsigned int memory_clock_rate);
742
+ void set_memory_bus_width(unsigned int memory_bus_width);
743
+ void
744
+ set_max_register_size_per_work_group(int max_register_size_per_work_group);
745
+ void set_device_id(uint32_t device_id);
746
+ void set_uuid(std::array<unsigned char, 16> uuid);
747
+ void set_global_mem_cache_size(unsigned int global_mem_cache_size);
730
748
};
731
749
```
732
750
@@ -797,6 +815,9 @@ destructor waits on a set of `sycl::event` which can be added to via
797
815
`add_event`. This is used, for example, to implement `syclcompat::free_async` to
798
816
schedule release of memory after a kernel or `mempcy`. SYCL device properties
799
817
can be queried through `device_ext` as well.
818
+ `device_ext` also provides the `has_capability_or_fail` member function, which
819
+ throws a `sycl::exception` if the device does not have the specified list of
820
+ `sycl::aspect`.
800
821
801
822
Users can manage queues through the `syclcompat::set_default_queue(sycl::queue q)`
802
823
free function, and the `device_ext` `set_saved_queue`, `set_default_queue`,
@@ -816,19 +837,26 @@ namespace syclcompat {
816
837
817
838
class device_ext : public sycl::device {
818
839
device_ext();
819
- device_ext(const sycl::device &base);
840
+ device_ext(const sycl::device &base, bool print_on_async_exceptions = false,
841
+ bool in_order = true);
820
842
~device_ext();
821
843
822
844
bool is_native_host_atomic_supported();
823
- int get_major_version();
824
- int get_minor_version();
825
- int get_max_compute_units();
826
- int get_max_clock_frequency();
827
- int get_integrated();
828
- void get_device_info(device_info &out);
845
+ int get_major_version() const;
846
+ int get_minor_version() const;
847
+ int get_max_compute_units() const;
848
+ int get_max_clock_frequency() const;
849
+ int get_integrated() const;
850
+ int get_max_sub_group_size() const;
851
+ int get_max_register_size_per_work_group() const;
852
+ int get_max_work_group_size() const;
853
+ int get_mem_base_addr_align() const;
854
+ size_t get_global_mem_size() const;
855
+ void get_memory_info(size_t &free_memory, size_t &total_memory) const;
829
856
830
- device_info get_device_info();
831
- void reset();
857
+ void get_device_info(device_info &out) const;
858
+ device_info get_device_info() const;
859
+ void reset(bool print_on_async_exceptions = false, bool in_order = true);
832
860
833
861
sycl::queue *default_queue();
834
862
void set_default_queue(const sycl::queue &q);
@@ -839,6 +867,9 @@ class device_ext : public sycl::device {
839
867
void set_saved_queue(sycl::queue *q);
840
868
sycl::queue *get_saved_queue();
841
869
sycl::context get_context();
870
+
871
+ void
872
+ has_capability_or_fail(const std::initializer_list<sycl::aspect> &props) const;
842
873
};
843
874
844
875
} // syclcompat
0 commit comments