"git@developer.sourcefind.cn:OpenDAS/fairseq.git" did not exist on "d2f3007ce9ebbfc455195e5db26426416877abbf"
Unverified Commit c81efdf2 authored by Jinjing Zhou's avatar Jinjing Zhou Committed by GitHub
Browse files

Remove deprecated kernels (#3316)

* remove

* remove

* fix

* remove

* remove
parent 75d793a1
/*!
* Copyright (c) 2019 by Contributors
* \file kernel/cuda/utils.cu
* \brief Utility function implementations on CUDA
*/
#include "../../runtime/cuda/cuda_common.h"
#include "../utils.h"
namespace dgl {
namespace kernel {
namespace utils {
template <typename DType>
__global__ void _FillKernel(DType* ptr, size_t length, DType val) {
int tx = blockIdx.x * blockDim.x + threadIdx.x;
int stride_x = gridDim.x * blockDim.x;
while (tx < length) {
ptr[tx] = val;
tx += stride_x;
}
}
template <int XPU, typename DType>
void Fill(const DLContext& ctx, DType* ptr, size_t length, DType val) {
auto* thr_entry = runtime::CUDAThreadEntry::ThreadLocal();
int nt = utils::FindNumThreads(length, 1024);
int nb = (length + nt - 1) / nt;
CUDA_KERNEL_CALL(_FillKernel, nb, nt, 0, thr_entry->stream, ptr, length, val);
}
template void Fill<kDLGPU, float>(const DLContext& ctx, float* ptr, size_t length, float val);
template void Fill<kDLGPU, double>(const DLContext& ctx, double* ptr, size_t length, double val);
} // namespace utils
} // namespace kernel
} // namespace dgl
This diff is collapsed.
This diff is collapsed.
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <cassert> #include <cassert>
#include "cuda_hashtable.cuh" #include "cuda_hashtable.cuh"
#include "../../kernel/cuda/atomic.cuh" #include "../../array/cuda/atomic.cuh"
#include "../../array/cuda/dgl_cub.cuh" #include "../../array/cuda/dgl_cub.cuh"
using namespace dgl::kernel::cuda; using namespace dgl::aten::cuda;
namespace dgl { namespace dgl {
namespace runtime { namespace runtime {
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "cuda_common.h" #include "cuda_common.h"
#include "../../runtime/workspace.h" #include "../../runtime/workspace.h"
#include "../../partition/ndarray_partition.h" #include "../../partition/ndarray_partition.h"
#include "../../kernel/cuda/atomic.cuh"
#include "../../array/cuda/dgl_cub.cuh" #include "../../array/cuda/dgl_cub.cuh"
#include "../../array/cuda/array_index_select.cuh" #include "../../array/cuda/array_index_select.cuh"
...@@ -44,7 +43,6 @@ ...@@ -44,7 +43,6 @@
namespace dgl { namespace dgl {
using namespace kernel::cuda;
using namespace partition; using namespace partition;
namespace runtime { namespace runtime {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment