-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkernel.h
More file actions
43 lines (29 loc) · 911 Bytes
/
kernel.h
File metadata and controls
43 lines (29 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef INFINI_OPS_HYGON_CAUSAL_SOFTMAX_KERNEL_H_
#define INFINI_OPS_HYGON_CAUSAL_SOFTMAX_KERNEL_H_
#include <utility>
// clang-format off
#include <cuda_runtime.h>
// clang-format on
// clang-format off
#include "hygon/device_.h"
// clang-format on
#include "cuda/causal_softmax/kernel.h"
namespace infini::ops {
namespace causal_softmax {
struct HygonBackend {
using stream_t = cudaStream_t;
static constexpr Device::Type kDeviceType = Device::Type::kHygon;
static constexpr int max_block_size = 256;
static int GetOptimalBlockSize() {
return ComputeOptimalBlockSize(QueryMaxThreadsPerBlock());
}
};
} // namespace causal_softmax
template <>
class Operator<CausalSoftmax, Device::Type::kHygon>
: public CudaCausalSoftmax<causal_softmax::HygonBackend> {
public:
using CudaCausalSoftmax<causal_softmax::HygonBackend>::CudaCausalSoftmax;
};
} // namespace infini::ops
#endif