-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathkernel_restrictions.h
65 lines (47 loc) · 1.58 KB
/
kernel_restrictions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
//
// SYCL 2020 Conformance Test Suite
//
// Provides descriptor for specific kernel requirements
//
*******************************************************************************/
#ifndef __SYCLCTS_UTIL_KERNEL_RESTRICTIONS_H
#define __SYCLCTS_UTIL_KERNEL_RESTRICTIONS_H
#include "../tests/common/common.h"
#include "aspect_set.h"
#include <string>
#include <utility>
namespace sycl_cts::util {
/** @brief Descriptor for specific kernel requirements
* @details See SYCL2020 rev.3 par. 5.7
*/
class kernel_restrictions {
/** @brief Stores set of aspects specific kernel requires
*/
aspect::aspect_set m_aspects;
std::pair<bool, size_t> sub_group_size;
size_t work_group_size[3];
int work_group_size_dims;
public:
kernel_restrictions();
void set_aspects(const aspect::aspect_set& aspects);
void set_sub_group_size(size_t value);
template <int dims>
void set_work_group_size(sycl::id<dims> value) {
work_group_size_dims = dims;
for (int i = 0; i < dims; ++i) {
work_group_size[i] = value[i];
}
}
void add_aspect(const sycl::aspect& asp);
void add_aspects(const aspect::aspect_set& asp);
void reset();
bool is_compatible(const sycl::device& device, std::string& info) const;
bool is_compatible(const sycl::device& device) const;
aspect::aspect_set get_aspects() const;
bool has_sub_group_size() const;
size_t get_sub_group_size() const;
std::string to_string() const;
};
} // namespace sycl_cts::util
#endif // __SYCLCTS_UTIL_KERNEL_RESTRICTIONS_H