diff --git a/src/device/pointer.jl b/src/device/pointer.jl index 0be5b0d4f4..baa7709f04 100644 --- a/src/device/pointer.jl +++ b/src/device/pointer.jl @@ -15,29 +15,41 @@ const Local = 5 end -## ldg +@inline @generated function pointerref_ldg(ptr::LLVMPtr{T,A}, i::I, ::Val{align}) where {T,A,I,align} + sizeof(T) == 0 && return T.instance + LLVM.@dispose ctx=LLVM.Context() begin + eltyp = convert(LLVM.LLVMType, T) -const LDGTypes = (UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64, - Float32, Float64) + T_idx = convert(LLVM.LLVMType, I) + T_ptr = convert(LLVM.LLVMType, ptr) -# TODO: this functionality should throw