Skip to content

Commit

Permalink
review updates:
Browse files Browse the repository at this point in the history
- cmake documentation
- take omp num thread into account for resource file

Co-authored-by: Yu-Hsiang M. Tsai <[email protected]>
  • Loading branch information
MarcelKoch and yhmtsai committed Aug 3, 2023
1 parent ba7b6ca commit c796297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmake/create_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ endfunction()
## Adds a test to the list executed by ctest and sets its output binary name
## Possible additional arguments:
## - `MPI_SIZE size` causes the tests to be run with `size` MPI processes.
## - `CORES` the number of threads used by a test, default is 4
## - `PERCENTAGE` usage percentage of a single GPU, default is 50
## - `RESOURCE_LOCAL_CORES` the number of threads used by a test, default is 4
## - `RESOURCE_PERCENTAGE` usage percentage of a single GPU, default is 25
## - `RESOURCE_TYPE` the resource type, can be ref, cpu, cudagpu, hipgpu, syclgpu
## - `DISABLE_EXECUTORS exec1 exec2` disables the test for certain backends (if built for multiple)
## - `ADDITIONAL_LIBRARIES lib1 lib2` adds additional target link dependencies
## - `ADDITIONAL_INCLUDES path1 path2` adds additional target include paths
Expand Down
3 changes: 2 additions & 1 deletion test/tools/resource_file_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ std::vector<std::string> split(const std::string& s, char delimiter = ',')
return tokens;
}


std::string create_json(const std::string& resources)
{
std::string json;
Expand All @@ -73,7 +74,7 @@ std::string create_json(const std::string& resources)

int main()
{
auto num_cpu_threads = std::max(std::thread::hardware_concurrency(), 1u);
auto num_cpu_threads = gko::OmpExecutor::get_num_omp_threads();
auto num_cuda_gpus = gko::CudaExecutor::get_num_devices();
auto num_hip_gpus = gko::HipExecutor::get_num_devices();
auto num_sycl_gpus = gko::DpcppExecutor::get_num_devices("gpu");
Expand Down

0 comments on commit c796297

Please sign in to comment.