GPU noob. I’ve simplified my problem here. I have a compression type which basically has information that yields the correct phase adjustment. But it is an abstract composite type which could have various memory footprints as shown below.
I’m trying to design something that could allow a vector of these different objects to be passed into a GPU and processed.
I supposed I might be able to do something with function handles instead of composite types for the codeStyle. But is there a way to do it the way I am attempting?
Best Regards,
Allan B
using CUDA
# This file is going to test putting together a GPU version of an array of various different memory structures
struct defaultCompType
a::Float64
b::Float64
c::Int64
end
abstract type codeStyle{CT} end
struct code1{CT<:NTuple} <: codeStyle{CT}
code::CT
s_chiplen::Float64
end
struct code2{CT<:NTuple} <: codeStyle{CT}
B::Float64
T::Float64
end
struct code3{CT<:NTuple} <: codeStyle{CT}
end
struct compressedCompType{CT<:NTuple}
w::defaultCompType
c::codeStyle{CT}
end
w1=compressedCompType{NTuple{}}(defaultCompType(1.0,2.0,3),code3{NTuple{}}())
w2=compressedCompType{NTuple{}}(defaultCompType(1.0,2.0,3),code3{NTuple{}}())
w3=compressedCompType{NTuple{}}(defaultCompType(1.0,2.0,3),code2{NTuple{}}(1.0,2.0))
w4=compressedCompType{Tuple{Int64,Int64,Int64}}(defaultCompType(1.0,2.0,3),code1{Tuple{Int64,Int64,Int64}}((1,2,3),4.0))
CuArray([w1,w2,w3]) # Works -- because of the NTuple thing is not there I guess
CuArray([w1,w2,w3,w4]) # Does not work -- what should I do?