mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Test softmax
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include <functional>
|
||||
#include <cmath>
|
||||
|
||||
#include "activation_functions.cuh"
|
||||
#include "cuda_helper.cuh"
|
||||
@@ -38,7 +38,7 @@ __global__ void CUDANet::Kernels::softmax_exp(
|
||||
int tid = blockDim.x * blockIdx.x + threadIdx.x;
|
||||
|
||||
for (int i = tid; i < len; i += stride) {
|
||||
dst[i] = exp(src[i]);
|
||||
dst[i] = std::exp(src[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void Layers::Activation::activate(float* __restrict__ d_input) {
|
||||
d_input, d_input, length
|
||||
);
|
||||
|
||||
Kernels::softmax_sum<<<gridSize, BLOCK_SIZE>>>(
|
||||
Kernels::softmax_sum<<<gridSize / 2, BLOCK_SIZE>>>(
|
||||
d_input, d_softmax_sum, length
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user