Skip to content

Commit 0e1c558

Browse files
authored
Merge pull request #358 from InfiniTensor/issue/342
issue/342: 昆仑芯P800上random_sample算子
2 parents 19d60bf + 1cadb2a commit 0e1c558

File tree

5 files changed

+694
-16
lines changed

5 files changed

+694
-16
lines changed

src/infiniop/devices/kunlun/kunlun_kernel_common.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,6 @@ __device__ inline void loadsm(__shared_ptr__ const T *p, T *v, int len) {
4343
__builtin_memcpy(v, p, len * sizeof(T));
4444
}
4545

46-
/**
47-
* @brief Convert data type. All data is in local memory
48-
* @param v: input value
49-
* @return output value
50-
*/
51-
template <typename Tout, typename Tin>
52-
__device__ inline Tout to(Tin v) {
53-
if constexpr (std::is_same<Tin, half>::value) {
54-
return __half2float(v);
55-
} else if constexpr (std::is_same<Tin, bfloat16_t>::value) {
56-
return __bfloat162float(v);
57-
} else {
58-
return static_cast<Tout>(v);
59-
}
60-
}
61-
6246
/**
6347
* @brief atomicAdd for kunlun xpu
6448
* @param ptr: pointer to shared memory

0 commit comments

Comments
 (0)