-
Notifications
You must be signed in to change notification settings - Fork 203
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Texture memory? #46
Comments
Tim and I discussed a better interface to texture memory and I think what Chris really wants is access to the interpolation for 3D texture memory |
Yes, I think I understand, kind of |
I guess that to support this, there must be a way to allocate, free, refer to and initialize texture memory, right? Would that require support in CuArrays.jl or only in CUDAnative.jl? |
The host-side API calls (allocate, initialize, free) would end up in CUDAdrv, while referring to and using texture memory would probably be implemented in CUDAnative.jl. We would also need to think about an appropriate abstraction, e.g. some sort of device-side array type that supports interpolations, but how to tie this into the existing CuArray/CuDeviceArray infrastructure, etc. |
I've done some experiments and I have been able to create texture objects with CUDAdrv.jl and then use interpolated texture fetch with CUDAnative.jl ; I have a repo with that, where the main file is I've used CBindingGen.jl and CBinding.jl to interface to some CUDA Driver API structs (see https://github.com/cdsousa/cuda_julia_experiments/blob/master/cudadrvbindings.jl). Also, I've used LLVM NVVM calls (https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#nvvm-intrin-texture-surface) since I don't know how to write assembly PTX code (JuliaGPU/CUDAnative.jl#158 (comment) and https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#texture-instructions). |
Sweet! I haven't taken a close look yet, but it's good to see that you can get there with plain Out of curiosity, why did you pick CBinding* over plain Clang.jl? I just yesterday made the CUDAdrv.jl wrappers autogenerated (using Clang.jl), so that should make it easier to do further experimentation: JuliaGPU/CUDAdrv.jl#157 |
I pick CBinding just because I knew none of them and CBinding seemed to be simple and do the job. The API for LLVM NVVM texture fetches seems to not be so complete as the PTX counterpart, e.g., I'm starting to develop a small package to handle CUDA textures. I'm planning a The reason for Unfortunately, I'm not sure my little free time will allow me to even depart from this initial phase. |
Hi @ChrisRackauckas, @maleadt and @vchuravy, I'm pleased to announce that I have made a working prototype package for using CUDA textures from CUDAnative.jl: https://github.com/cdsousa/CuTextures.jl Just scroll down on the readme page to see what is already possible to do with it 馃槈 I think I have already done many of the "hard" parts, and what is remaining is adding some flexibility and check, and possibly improve, code for performance. |
That's awesome! I need to give it a closer look, but it looks great. |
Thanks, I would prefer it merged indeed. |
Let me note that I'm completely OK with changing and improving namings, APIs, internals... |
We would like to make use of the texture memory functionality for high-dimensional interpolations. @vchuravy said it would be easy 馃憤 .
The text was updated successfully, but these errors were encountered: