Merge kernel caching logic for CUDA and OpenCL backends#2873
Merged
9prady9 merged 1 commit intoarrayfire:masterfrom May 12, 2020
Merged
Merge kernel caching logic for CUDA and OpenCL backends#28739prady9 merged 1 commit intoarrayfire:masterfrom
9prady9 merged 1 commit intoarrayfire:masterfrom
Conversation
cfce703 to
b95f71c
Compare
umar456
previously requested changes
May 12, 2020
Member
umar456
left a comment
There was a problem hiding this comment.
Looks great. Excellent documentation of the new functions. Can't wait to get rid of the old OpenCL kernel lookups.
* Moved common code required by CUDA and OpenCL caching algorithm into
kernel_cache.[hpp|cpp]
* Added common/compile_kernel.hpp header that defines the signature
of the function, compileKernel, that each backend has to implement.
* Each backend has to implement/satisfy the following requirements:
- Provide compile_kernel.cpp source with compileKernel function that is
used by common::findKernel
- Provide Kernel.hpp/cpp that implements KernelInterface from
common/KernelInterface.hpp
- Kernel.hpp also provides a functor than helps launch backend kernels.
* Moved kernel utility helpers into separate header(s)/source:
- TemplateArg.hpp/cpp contains the TemplateArg struct and some helper macros
to convert template arguments to strings.
- TemplateTypename.hpp contains the templated TemplateTypename struct that
helps to convert backend kernel paramters to TemplateArg object.
* Refactored all CUDA kernels to use the new caching API
* Refactored only transpose, morph and canny to use new caching API from OpenCL
* Reduced lot of unnecessary instantiations for morphological functions
b95f71c to
dd9d3af
Compare
umar456
approved these changes
May 12, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Partially addresses tasks from #2857