-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Non-static bounce buffer option (#454)
closes #451 closes #452 Also some refactor/clean up Authors: - Mads R. B. Kristensen (https://github.com/madsbk) Approvers: - Lawrence Mitchell (https://github.com/wence-) URL: #454
- Loading branch information
Showing
9 changed files
with
164 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. | ||
# See file LICENSE for terms. | ||
|
||
from kvikio._lib import buffer # type: ignore | ||
|
||
|
||
def memory_register(buf) -> None: | ||
"""Register a device memory allocation with cuFile. | ||
Warning | ||
------- | ||
This API is intended for usecases where the memory is used as a streaming | ||
buffer that is reused across multiple cuFile IO operations. | ||
Parameters | ||
---------- | ||
buf: buffer-like or array-like | ||
Device buffer to register . | ||
""" | ||
return buffer.memory_register(buf) | ||
|
||
|
||
def memory_deregister(buf) -> None: | ||
"""Deregister an already registered device memory from cuFile. | ||
Parameters | ||
---------- | ||
buf: buffer-like or array-like | ||
Device buffer to deregister . | ||
""" | ||
buffer.memory_deregister(buf) | ||
|
||
|
||
def bounce_buffer_free() -> int: | ||
"""Free the host allocations used as bounce buffers. | ||
Returns | ||
------- | ||
Number of bytes freed. | ||
""" | ||
return buffer.bounce_buffer_free() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.