Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
025824d2
Commit
025824d2
authored
Jul 01, 2022
by
Max Ryabinin
Browse files
Reduce diff
parent
575aa698
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
csrc/ops.cu
csrc/ops.cu
+8
-0
No files found.
csrc/ops.cu
View file @
025824d2
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment