Skip to content

Commit

Permalink
Use device_selector in group_functions test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbalint98 committed Feb 20, 2024
1 parent 10defa6 commit bf9e10a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/sycl/group_functions/group_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <sstream>
#include <string>

using namespace cl;
#include <sycl/sycl.hpp>

#ifndef __HIPSYCL_ENABLE_SPIRV_TARGET__
#define HIPSYCL_ENABLE_GROUP_ALGORITHM_TESTS
Expand Down Expand Up @@ -268,11 +268,20 @@ void check_binary_reduce(std::vector<T> buffer, size_t local_size, size_t global
template<int N, int M, typename T>
class test_kernel;

int gpu_selector(const sycl::device &dev) {
if(dev.has(sycl::aspect::gpu)){
return 1;
}else{
return -1;
}
}

template<int CallingLine, typename T, typename DataGenerator, typename TestedFunction,
typename ValidationFunction>
void test_nd_group_function_1d(size_t elements_per_thread, DataGenerator dg,
TestedFunction f, ValidationFunction vf) {
sycl::queue queue;

sycl::queue queue{gpu_selector};
std::vector<size_t> local_sizes = {25, 144, 256};
std::vector<size_t> global_sizes = {100, 576, 1024};
// currently only groupsizes between 128 and 256 are supported for HIP
Expand Down

0 comments on commit bf9e10a

Please sign in to comment.