-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[OpenCL][Texture] Improved texture memory planning #15058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2b48572
[OpenCL][Texture] Improved texture memmory planning and runtime memor…
srkreddy1238 22ca220
* improve texture allocations.
srkreddy1238 70babe2
* Now we support texture under pooled allocator.
srkreddy1238 d615a55
* improve OpenCL Texture cpp test cases.
srkreddy1238 24610c8
* Device API follows the executor Allocator type.
srkreddy1238 6ca6a53
* More tests for allocators to cover various conflicts.
srkreddy1238 4153c1b
* Try to use existing allocator else create Naive.
srkreddy1238 4ab4656
* Minor change for better usability.
srkreddy1238 2da1716
* bug fix.
srkreddy1238 40de788
Update src/runtime/opencl/opencl_device_api.cc
srkreddy1238 54d4dfd
* review comments
srkreddy1238 4fb2646
Merge branch 'main' into texture_enhancements
srkreddy1238 cce9518
Merge branch 'main' into texture_enhancements
srkreddy1238 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ enum DeviceAttrKind : int { | |
| kDriverVersion = 12, | ||
| kL2CacheSizeBytes = 13, | ||
| kTotalGlobalMemory = 14, | ||
| kImagePitchAlignment = 15, | ||
| }; | ||
|
|
||
| #ifdef TVM_KALLOC_ALIGNMENT | ||
|
|
@@ -134,12 +135,32 @@ class TVM_DLL DeviceAPI { | |
| */ | ||
| virtual void* AllocDataSpace(Device dev, int ndim, const int64_t* shape, DLDataType dtype, | ||
| Optional<String> mem_scope = NullOpt); | ||
|
|
||
| /*! | ||
| * \brief Create a new view with given spec over existing tensor. | ||
| * \param dev The device device to perform operation. | ||
| * \param data The source array. | ||
| * \param shape The shape of allocated tensor. | ||
| * \param dtype The type of elements. | ||
| * \param mem_scope The memory scope of allocated tensor. | ||
| * \return The allocated device pointer. | ||
| */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this set of changes. I feel that maybe we need something different that makes the memory allocator more explicit. Let me elaborate in reply |
||
| virtual void* AllocDataSpaceView(Device dev, void* data, ShapeTuple shape, DLDataType dtype, | ||
| Optional<String> mem_scope = NullOpt); | ||
| /*! | ||
| * \brief Free a data space on device. | ||
| * \param dev The device device to perform operation. | ||
| * \param ptr The data space. | ||
| */ | ||
| virtual void FreeDataSpace(Device dev, void* ptr) = 0; | ||
|
|
||
| /*! | ||
| * \brief Free a view data space on device. | ||
| * \param dev The device device to perform operation. | ||
| * \param ptr The data space view. | ||
| */ | ||
| virtual void FreeDataSpaceView(Device dev, void* ptr); | ||
|
|
||
| /*! | ||
| * \brief copy data from one place to another | ||
| * \note This API is designed to support special memory with shape dependent layout. | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.