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
7be5f2c7
Commit
7be5f2c7
authored
Jul 16, 2023
by
Tim Dettmers
Browse files
Guard for prefetchAsync GPU capability. #470 #451 #477
parent
f3232d13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
csrc/pythonInterface.c
csrc/pythonInterface.c
+5
-0
No files found.
csrc/pythonInterface.c
View file @
7be5f2c7
...
...
@@ -385,6 +385,11 @@ extern "C"
void
cprefetch
(
void
*
ptr
,
size_t
bytes
,
int
device
)
{
int
hasPrefetch
=
0
;
CUDA_CHECK_RETURN
(
cudaDeviceGetAttribute
(
&
hasPrefetch
,
cudaDevAttrConcurrentManagedAccess
,
device
));
// 40ns overhead
if
(
hasPrefetch
==
0
)
return
;
CUDA_CHECK_RETURN
(
cudaMemPrefetchAsync
(
ptr
,
bytes
,
device
,
0
));
CUDA_CHECK_RETURN
(
cudaPeekAtLastError
());
}
...
...
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