Skip to content

Commit

Permalink
Implement device_init for sycl (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
rscohn2 authored Aug 2, 2024
1 parent e47bde8 commit 8c5841c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tools/util/include/cutlass/util/helper_cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ namespace cute
void
device_init(int device_id, bool quiet = false)
{

#if defined(CUTLASS_ENABLE_SYCL)

syclcompat::select_device(device_id);
auto &device = syclcompat::get_current_device();

if (!quiet) {
printf("Using device %d: %s (%d Compute Units)\n",
device_id, device.get_device_info().get_name(),
device.get_max_compute_units()
);
fflush(stdout);
}

#else

cudaDeviceProp device_prop;
std::size_t device_free_physmem;
std::size_t device_total_physmem;
Expand All @@ -65,6 +81,9 @@ device_init(int device_id, bool quiet = false)
device_prop.multiProcessorCount);
fflush(stdout);
}

#endif

}

/**
Expand Down

0 comments on commit 8c5841c

Please sign in to comment.