Comments (5)
Presumably you first have to move the memory over to the GPU. Does it work if you say launch(..., (CudaArray(iostr.data),))
?
from cudart.jl.
No, I don't. If I understand correctly from documentation, cuLaunchKernel copies the arguments itself when those arguments are passed by value. For example, if you pass it a pointer to a device pointer, the device pointer will be copied and used to initialize the function argument, and if you give it a pointer to an int, the int will be copied by cuLaunchKernel, then used to initialize an argument of type int
(not int*
or something). So all I need is to be able to give it a pointer to the structure in host memory, and it copies the structure itself, initializing function argument from the host memory.
It's just that the interface of launch
doesn't let me do that, hence the issue. The way to get around is to ccall((:cuLaunchKernel, ...
with kernel arguments set to Ptr{Void}[iostr.data]
.
Also, I believe arguments are copied to either constant or shared memory (I'm not sure which), not global memory.
from cudart.jl.
With Ptr{Void}
, how does it know how many bytes to copy over? Different structures have different sizes.
from cudart.jl.
It knows the kernel function definition, and the definitions of types of its arguments, like a C compiler would, so that's how it knows how many bytes to copy and how to interpret them. So if I tell StrPack to use the right (for nvcc) alignment (align_native
? It seems distinct from align_default
for some reason), then the structure is laid out in memory correctly and cuda can read it itself without being told anything else.
from cudart.jl.
You're right that the kernel function itself is a good source of information. If that really works, fantastic.
It's certainly fine to change the interface of launch
if it expands the scope of what it can do. Once you get something working that passes the tests, please do submit a PR.
from cudart.jl.
Related Issues (20)
- Tests fail on Windows with 0.6 HOT 1
- Info about upcoming removal of packages in the General registry
- Support for ptx modules with external functions HOT 2
- Does CUDArt support cuda 8.0? HOT 1
- triggering gc based on gpu memory
- CUDArt assumptions not robust
- Precompile Error HOT 1
- Intermittent GC-related test failure (`isempty(cuda_ptrs)`) HOT 2
- New tag HOT 2
- Updated build script for visual studio 17 but get compile errors HOT 2
- error could not load library "libnvidia-ml" HOT 4
- Makefile needs to select correct gcc compiler HOT 1
- Rename types to CuArray, CuMatrix and so forth for consistency with CUDAdrv?
- CUDArt should not rely on `nvidia-smi` or `nvml` on Mac OSX HOT 31
- CUDArt fails to build when no CUDA device is present
- gcc5.4.0 support HOT 1
- OOB during package build HOT 7
- No method matching reset(::Cudadrv.CuPrimaryContext) HOT 3
- GCC Version On CUDA 8.0 HOT 3
- Unified Memory support HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cudart.jl.