-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquant_gpu.h
More file actions
55 lines (41 loc) · 1.85 KB
/
quant_gpu.h
File metadata and controls
55 lines (41 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __QUANT_GPU_H__
#define __QUANT_GPU_H__
#include "cuda_timer.h"
#include "wavelet.h"
bool quantizeGPU(int *outputData, const float *inputData, int count,
WaveletCompressionParam ¶m,
const float *nonzeroData_dev, int nonzeroCount,
float maxAbsVal, float minValue, float maxValue,
CudaTimer &quantizeTimer, int *zeroBin = NULL);
bool dequantizeGPU(float *result_dev, const int *input_dev,
int count, const WaveletCompressionParam ¶m);
void computeLloydQuantizationGPU(const float *inputData, int count,
int binCount, float minVal, float maxVal,
float thresholdValue,
std::vector<float> &quantBinBoundaries,
std::vector<float> &quantBinValues);
void __global__ quantUniformKernel
(int *output, const float *input, int count,
int binCount, float threshold, float max);
void __global__ quantLogKernel
(int *output, const float *input, int count,
int binCount, float threshold, float max);
void __global__ quantCodebookKernel
(int *output, const float *input, int count,
const float * __restrict boundaries, int boundaryCount);
void quantCodebookGPU
(int *output, const float *input, int dataCount,
const vector<float> &boundaries, int binCount);
void __global__ dequantUniformKernel
(float *output, const int *input, int count,
int binCount, float threshold, float max);
void __global__ dequantLogKernel
(float *data, const int *input, int count,
int binCount, float threshold, float max);
void __global__ dequantCodebookKernel
(float *output, const int *input, int count,
const float *binValues, int binCount);
void dequantCodebookGPU
(float *output, const int *input, int count,
const vector<float> &binValues);
#endif // __QUANT_GPU_H__