Skip to content

Commit

Permalink
Fix includes and namespace conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
  • Loading branch information
devreal committed Sep 18, 2024
1 parent 53f2b80 commit b468a0c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ttg/ttg/device/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,28 @@ namespace ttg::device {
constexpr const Stream default_stream_v = default_stream<Stream>::value;
} // namespace detail

} // namespace ttg

#if defined(TTG_HAVE_CUDA)
#include <cuda_runtime.h>
namespace ttg::device {
constexpr ttg::ExecutionSpace available_execution_space = ttg::ExecutionSpace::CUDA;
using Stream = cudaStream_t;
} // namespace ttg::device
#elif defined(TTG_HAVE_HIP)
#include <hip/hip_runtime.h>
namespace ttg::device {
constexpr ttg::ExecutionSpace available_execution_space = ttg::ExecutionSpace::HIP;
using Stream = hipStream_t;
} // namespace ttg::device
#elif defined(TTG_HAVE_LEVEL_ZERO)
#include <CL/sycl.hpp>
namespace ttg::device {
constexpr ttg::ExecutionSpace available_execution_space = ttg::ExecutionSpace::L0;
using Stream = std::add_reference_t<sycl::queue>;
} // namespace ttg::device
#else

namespace ttg::device {
struct Stream { };
namespace detail {
template<>
Expand All @@ -98,8 +106,10 @@ namespace ttg::device {
};
} // namespace detail
constexpr ttg::ExecutionSpace available_execution_space = ttg::ExecutionSpace::Host;
} // namespace ttg::device
#endif

namespace ttg::device {

#if !defined(TTG_HAVE_LEVEL_ZERO)
namespace detail {
Expand Down

0 comments on commit b468a0c

Please sign in to comment.