BitVector Adapt GPUs

Can’t walk thought debugger as the logic happens with the typeof. Do you know what this means,

julia> typeof(wfcw64).flags
0x72

julia> typeof(wfcw64).flags & 0x08
0x00

typeof(x).flags & 0x08 == 0x08 to pass the isbits.

This fixes it. Don’t know if it is as expected

struct Waveform{T<:ValidWFType,CT<:NTuple,PMT<:PulseModulationStyle{T,CT}}  
    ...
   compression::PMT 
end

julia>  @show isbits(wfcw64)
isbits(wfcw64) = true
1 Like

It is, good going.

One more note on

There’s some subtlety to this that I didn’t explain, partially out of laziness. CT<:AbstractVector does work on GPU, but I presume you ditched it because isbits() was always false. Why does it work on GPU then? That’s because CUDA.jl actually automatically converts CuArrays (not isbits) to CuDeviceArrays (isbits) before passing them to a kernel. This happens behind the scenes so you don’t notice it most of the time, but if you were to @cuprintf typeof(array) in a kernel you would.

Thanks for that clarification. I have another issue that I don’t know the best way to define a vector of these items.

Say I have that Waveform object above:

struct 
Waveform{T<:ValidWFType,CT<:NTuple,PMT<:PulseModulationStyle{T,CT}}  

mutable struct TransmissionBuffer{W<:Waveform}
	buffer::Vector{W}
	maximumSize::Int # The number to allow before wrapping around
end

tb=TransmissionBuffer{???}(10)

What do I put in the ??? place, so I can add Waveforms that may have different compression types.

It appears that TransmissionBuffer{Waveform})10 works just fine.

The problem I’m having is converting the Vector of Waveforms that Transmission buffer has, into a CuArray. The CuArray only supports element types tha are stored inline.

I naively thought I could just do something like this: CuArray{W}(TB.buffer) where TB is the transmissionBuffer which has a vector of {W}.

Does anyone know the correct syntax to convert a vector of the Waveform object to a CuArray of Waveform Objects.

It seems like I have a fundamental flaw. The “waveform type” I have created has a PulseModulationType which can be currently one of three vastly different types and memory sizes.

I’m not sure how I am able to resolve this. I may try to come-up with another example that is easier to push on these forums.