Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jan 2, 2018
1 parent a8b2e3c commit 51728b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ struct CuDim3
z::Cuint
end

CuDim3(g::T) where {T <: Integer} = CuDim3(g, Cuint(1), Cuint(1))
CuDim3(g::NTuple{1,T}) where {T <: Integer} = CuDim3(g[1], Cuint(1), Cuint(1))
CuDim3(g::NTuple{2,T}) where {T <: Integer} = CuDim3(g[1], g[2], Cuint(1))
CuDim3(g::NTuple{3,T}) where {T <: Integer} = CuDim3(g[1], g[2], g[3])
CuDim3(dims::CuDim3) = dims
CuDim3(dims::Integer) = CuDim3(dims, Cuint(1), Cuint(1))
CuDim3(dims::NTuple{1,<:Integer}) = CuDim3(dims[1], Cuint(1), Cuint(1))
CuDim3(dims::NTuple{2,<:Integer}) = CuDim3(dims[1], dims[2], Cuint(1))
CuDim3(dims::NTuple{3,<:Integer}) = CuDim3(dims[1], dims[2], dims[3])

# Type alias for conveniently specifying the dimensions
# (e.g. `(len, 2)` instead of `CuDim3((len, 2))`)
Expand Down Expand Up @@ -207,8 +208,7 @@ end
end
end

push!(ex.args, :(launch(f, CuDim3(griddim), CuDim3(blockdim), shmem, stream,
($(arg_ptrs...),))))
push!(ex.args, :(launch(f, griddim, blockdim, shmem, stream, ($(arg_ptrs...),))))

return ex
end

0 comments on commit 51728b1

Please sign in to comment.