Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/CUDAKernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ export CUDABackend
struct CUDABackend <: KA.GPU
prefer_blocks::Bool
always_inline::Bool
fastmath::Bool
end

CUDABackend(; prefer_blocks=false, always_inline=false) = CUDABackend(prefer_blocks, always_inline)
CUDABackend(; prefer_blocks=false, always_inline=false, fastmath=false) = CUDABackend(prefer_blocks, always_inline, fastmath)

KA.allocate(::CUDABackend, ::Type{T}, dims::Tuple) where T = CuArray{T}(undef, dims)
KA.zeros(::CUDABackend, ::Type{T}, dims::Tuple) where T = CUDA.zeros(T, dims)
Expand Down Expand Up @@ -100,7 +101,7 @@ function (obj::KA.Kernel{CUDABackend})(args...; ndrange=nothing, workgroupsize=n
maxthreads = nothing
end

kernel = @cuda launch=false always_inline=backend.always_inline maxthreads=maxthreads obj.f(ctx, args...)
kernel = @cuda launch=false always_inline=backend.always_inline fastmath=backend.fastmath maxthreads=maxthreads obj.f(ctx, args...)

# figure out the optimal workgroupsize automatically
if KA.workgroupsize(obj) <: KA.DynamicSize && workgroupsize === nothing
Expand Down