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
9 changes: 9 additions & 0 deletions source/lib/src/cuda/gelu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ void gelu_gpu_cuda(
const FPTYPE * xx,
const int size)
{
if(size <= 0){
return;
}
const int THREAD_ITEMS = 1024;
const int BLOCK_NUMS = (size + THREAD_ITEMS - 1) / THREAD_ITEMS;

Expand All @@ -68,6 +71,9 @@ void gelu_grad_gpu_cuda(
const FPTYPE * dy,
const int size)
{
if(size <= 0){
return;
}
const int THREAD_ITEMS = 1024;
const int BLOCK_NUMS = (size + THREAD_ITEMS - 1) / THREAD_ITEMS;

Expand All @@ -82,6 +88,9 @@ void gelu_grad_grad_gpu_cuda(
const FPTYPE * dy_2,
const int size)
{
if(size <= 0){
return;
}
const int THREAD_ITEMS = 1024;
const int BLOCK_NUMS = (size + THREAD_ITEMS - 1) / THREAD_ITEMS;

Expand Down