Skip to content
Merged
Show file tree
Hide file tree
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
45 changes: 4 additions & 41 deletions src/native/cuda/iluvatar/runtime_.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@ namespace infini::rt::runtime {

template <>
struct Runtime<Device::Type::kIluvatar>
: GraphRuntime<Runtime<Device::Type::kIluvatar>,
CudaRuntime<Runtime<Device::Type::kIluvatar>>> {
: CudaRuntime<Runtime<Device::Type::kIluvatar>> {
using Error = cudaError_t;

using Stream = cudaStream_t;

using Graph = cudaGraph_t;

using GraphExec = cudaGraphExec_t;

using Event = cudaEvent_t;

using StreamCaptureMode = cudaStreamCaptureMode;

static constexpr Device::Type kDeviceType = Device::Type::kIluvatar;

static constexpr Error kSuccess = cudaSuccess;
Expand Down Expand Up @@ -84,7 +77,9 @@ struct Runtime<Device::Type::kIluvatar>
return cudaMemsetAsync(std::forward<decltype(args)>(args)...);
};

static constexpr auto StreamCreate = cudaStreamCreate;
static constexpr auto StreamCreate = [](auto&&... args) {
return cudaStreamCreate(std::forward<decltype(args)>(args)...);
};

static constexpr auto StreamDestroy = [](auto&&... args) {
return cudaStreamDestroy(std::forward<decltype(args)>(args)...);
Expand Down Expand Up @@ -125,38 +120,6 @@ struct Runtime<Device::Type::kIluvatar>
static constexpr auto EventElapsedTime = [](auto&&... args) {
return cudaEventElapsedTime(std::forward<decltype(args)>(args)...);
};

static constexpr auto kStreamCaptureModeGlobal = cudaStreamCaptureModeGlobal;

static constexpr auto kStreamCaptureModeThreadLocal =
cudaStreamCaptureModeThreadLocal;

static constexpr auto kStreamCaptureModeRelaxed =
cudaStreamCaptureModeRelaxed;

static constexpr auto StreamBeginCapture = [](auto&&... args) {
return cudaStreamBeginCapture(std::forward<decltype(args)>(args)...);
};

static constexpr auto StreamEndCapture = [](auto&&... args) {
return cudaStreamEndCapture(std::forward<decltype(args)>(args)...);
};

static constexpr auto GraphDestroy = [](auto&&... args) {
return cudaGraphDestroy(std::forward<decltype(args)>(args)...);
};

static constexpr auto GraphInstantiate = [](auto&&... args) {
return cudaGraphInstantiate(std::forward<decltype(args)>(args)...);
};

static constexpr auto GraphExecDestroy = [](auto&&... args) {
return cudaGraphExecDestroy(std::forward<decltype(args)>(args)...);
};

static constexpr auto GraphLaunch = [](auto&&... args) {
return cudaGraphLaunch(std::forward<decltype(args)>(args)...);
};
};

static_assert(Runtime<Device::Type::kIluvatar>::Validate());
Expand Down
2 changes: 0 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ if(WITH_ILUVATAR)
ILUVATAR infini::rt::Device::Type::kIluvatar
infini/rt/iluvatar/runtime_.h
1 1 1 1 1 1 1 1)
add_infini_rt_backend_graph_test(
ILUVATAR infini::rt::Device::Type::kIluvatar 1)
endif()

if(WITH_HYGON)
Expand Down
Loading