summaryrefslogtreecommitdiff
path: root/csrc
diff options
context:
space:
mode:
authorMax Ryabinin <mryabinin0@gmail.com>2022-07-01 17:42:58 +0300
committerMax Ryabinin <mryabinin0@gmail.com>2022-07-01 17:42:58 +0300
commit025824d29b38f6b981bbcea8a61bc23e7f2b3e02 (patch)
tree477d50668a4d062996364a88f6e61d7e380e77e5 /csrc
parent575aa698fa53df2f5c584413aed7bf7714f86039 (diff)
Reduce diff
Diffstat (limited to 'csrc')
-rw-r--r--csrc/ops.cu8
1 files changed, 8 insertions, 0 deletions
diff --git a/csrc/ops.cu b/csrc/ops.cu
index dbb50be..40c185c 100644
--- a/csrc/ops.cu
+++ b/csrc/ops.cu
@@ -41,6 +41,14 @@ void quantize(float *code, float *A, unsigned char *out, int n)
CUDA_CHECK_RETURN(cudaPeekAtLastError());
}
+void dequantize(float *code, unsigned char *A, float *out, int n)
+{
+ int blocks = n/1024;
+ blocks = n % 1024 == 0 ? blocks : blocks + 1;
+ kDequantize<<<blocks, 1024>>>(code, A, out, n);
+ CUDA_CHECK_RETURN(cudaPeekAtLastError());
+}
+
template <typename T, int STOCHASTIC> void quantizeBlockwise(float * code, T *A, float *absmax, unsigned char *out, float *rand, int rand_offset, const int n)
{
int blocks = n/4096;