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
14 changes: 11 additions & 3 deletions src/native/cuda/metax/runtime_.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <mcr/mc_runtime.h>

#include <utility>

#include "native/cuda/metax/device_.h"
#include "native/cuda/runtime_.h"

Expand All @@ -23,11 +25,17 @@ struct Runtime<Device::Type::kMetax>

static constexpr auto DeviceSynchronize = mcDeviceSynchronize;

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

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

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

static constexpr auto MemcpyHostToHost = mcMemcpyHostToHost;

Expand Down
12 changes: 9 additions & 3 deletions src/native/cuda/moore/runtime_.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ struct Runtime<Device::Type::kMoore>

static constexpr auto SetDevice = musaSetDevice;

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

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

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

static constexpr auto Malloc = [](auto&&... args) {
return musaMalloc(std::forward<decltype(args)>(args)...);
Expand Down
Loading