Skip to content
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

Passing Symbol as a an argument fails #2590

Open
vchuravy opened this issue Dec 12, 2024 · 0 comments
Open

Passing Symbol as a an argument fails #2590

vchuravy opened this issue Dec 12, 2024 · 0 comments
Labels
cuda kernels Stuff about writing CUDA kernels. good first issue Good for newcomers

Comments

@vchuravy
Copy link
Member

After JuliaGPU/GPUCompiler.jl#650
we should be able to pass Symbols as arguments.

This fails in

param_usage = sum(sizeof, argtypes)
due to Julia telling us the wrong thing...

I guess we will need to pass them as Ptr{Cvoid} equivalent.

 ERROR: LoadError: Type Symbol does not have a definite size.
 Stacktrace:
   [1] sizeof
     @ ./essentials.jl:780 [inlined]
   [2] _mapreduce(f::typeof(sizeof), op::typeof(Base.add_sum), ::IndexLinear, A::Vector{DataType})
     @ Base ./reduce.jl:440
   [3] _mapreduce_dim(f::Function, op::Function, ::Base._InitialValue, A::Vector{DataType}, ::Colon)
     @ Base ./reducedim.jl:337
   [4] mapreduce
     @ ./reducedim.jl:329 [inlined]
   [5] _sum
     @ ./reducedim.jl:987 [inlined]
   [6] sum(f::Function, a::Vector{DataType})
     @ Base ./reducedim.jl:983
   [7] compile(job::GPUCompiler.CompilerJob)
     @ CUDA ~/.julia/packages/CUDA/BZS7Q/src/compiler/compilation.jl:284
   [8] actual_compilation(cache::Dict{Any, CUDA.CuFunction}, src::Core.MethodInstance, world::UInt64, cfg::GPUCompiler.CompilerConfig{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}, compiler::typeof(CUDA.compile), linker::typeof(CUDA.link))
     @ GPUCompiler ~/.julia/packages/GPUCompiler/8Yisz/src/execution.jl:237
   [9] cached_compilation(cache::Dict{Any, CUDA.CuFunction}, src::Core.MethodInstance, cfg::GPUCompiler.CompilerConfig{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}, compiler::Function, linker::Function)
     @ GPUCompiler ~/.julia/packages/GPUCompiler/8Yisz/src/execution.jl:151
  [10] macro expansion
     @ ~/.julia/packages/CUDA/BZS7Q/src/compiler/execution.jl:380 [inlined]
  [11] macro expansion
     @ ./lock.jl:273 [inlined]
  [12] cufunction(f::typeof(gpu_apply_collision_kernel), tt::Type{Tuple{KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicCheck, Nothing, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.StaticSize{(64,)}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, Nothing}}, CUDA.CuDeviceVector{Float64, 1}, CUDA.CuDeviceMatrix{Float64, 1}, CUDA.CuDeviceMatrix{Float64, 1}, Int64, Float64, Symbol}}; kwargs::@Kwargs{always_inline::Bool, maxthreads::Int64})
@maleadt maleadt added good first issue Good for newcomers cuda kernels Stuff about writing CUDA kernels. labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda kernels Stuff about writing CUDA kernels. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants