Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gemm3 perf test: user CUDA, SYCL, or HIP device for kokkos:initialize #2058

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,19 @@ void run(const blas3_gemm_params& params) {
int main(int argc, char** argv) {
const auto params = blas3_gemm_params::get_params(argc, argv);
const int num_threads = params.use_openmp;
const int device_id = params.use_cuda - 1;

// the common parameter parser takes the requested device ID and
// adds 1 to it (e.g. --cuda 0 -> params.use_cuda = 1)
// this is presumably so that 0 can be a sentinel value,
// even though device ID 0 is valid
// here, we use CUDA, SYCL, or HIP, whichever is set first, to
// choose which device Kokkos should initialize on
// or -1, for no such selection
const int device_id =
params.use_cuda
? params.use_cuda - 1
: (params.use_sycl ? params.use_sycl - 1
: (params.use_hip ? params.use_hip - 1 : -1));

Kokkos::initialize(Kokkos::InitializationSettings()
.set_num_threads(num_threads)
Expand Down