"git@developer.sourcefind.cn:OpenDAS/bitsandbytes.git" did not exist on "e4a9a94c75255af1f066f364a5641c5fe152065e"
Commit 64bb1ae8 authored by Phil Wang's avatar Phil Wang
Browse files

add a sign function, for lion

parent 8de29fc3
...@@ -217,6 +217,14 @@ __device__ __forceinline__ unsigned char quantize_quadrant(int QUADRANT, float * ...@@ -217,6 +217,14 @@ __device__ __forceinline__ unsigned char quantize_quadrant(int QUADRANT, float *
} }
} }
// sign function for lion
// taken from https://stackoverflow.com/a/4609795, but not sure if there's a proper way to do this in CUDA
template <typename T>
__device__ int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
__global__ void kHistogramScatterAdd2D(float* histogram, int *index1, int *index2, float *src, const int maxidx1, const int n) __global__ void kHistogramScatterAdd2D(float* histogram, int *index1, int *index2, float *src, const int maxidx1, const int n)
{ {
const int tid = threadIdx.x + (blockDim.x*blockIdx.x); const int tid = threadIdx.x + (blockDim.x*blockIdx.x);
......
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