Skip to content

Commit

Permalink
Add default value for device id
Browse files Browse the repository at this point in the history
  • Loading branch information
pciolkosz committed Jul 24, 2024
1 parent eb8b152 commit 2278e29
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cudax/include/cuda/experimental/__device/device.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#define _CUDAX__DEVICE_DEVICE

#include <cuda_runtime_api.h>
// cuda_runtime_api needs to come first

#include <cuda/std/detail/__config>

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
Expand All @@ -32,16 +30,15 @@ namespace cuda::experimental
//! @brief A non-owning representation of a CUDA device
struct device
{
int __id;
int __id = 0;

//! @brief Retrieve the native ordinal of the device
//!
//! @return int The native device ordinal held by the device object
_CCCL_NODISCARD constexpr int get() const noexcept
{
_CCCL_NODISCARD constexpr int get() const noexcept {
return __id;
}
};

} // namespace cuda::experimental
}
#endif

0 comments on commit 2278e29

Please sign in to comment.