Skip to content
Merged
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
41 changes: 41 additions & 0 deletions src/iluvatar/add/kernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef INFINI_OPS_ILUVATAR_ADD_KERNEL_H_
#define INFINI_OPS_ILUVATAR_ADD_KERNEL_H_

#include <utility>

// clang-format off
#include <cuda_runtime.h>
// clang-format on

#include "cuda/add/kernel.h"

namespace infini::ops {

namespace add {

struct IluvatarBackend {
using stream_t = cudaStream_t;

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

static constexpr auto memcpy = cudaMemcpy;

static constexpr auto free = cudaFree;

static constexpr auto memcpyH2D = cudaMemcpyHostToDevice;
};

} // namespace add

template <>
class Operator<Add, Device::Type::kIluvatar>
: public CudaAdd<add::IluvatarBackend> {
public:
using CudaAdd<add::IluvatarBackend>::CudaAdd;
};

} // namespace infini::ops

#endif