RWKV-Runner/backend-python/rwkv_pip/beta/cuda/util.h

8 lines
240 B
C
Raw Normal View History

2023-08-14 22:07:15 +08:00
#include "ATen/ATen.h"
#include <cuda_fp16.h>
template <typename T> T *data_ptr(torch::Tensor x) { return x.data_ptr<T>(); }
template <> inline half *data_ptr(torch::Tensor x) {
return reinterpret_cast<half *>(x.data_ptr<at::Half>());
}