LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Malleable VI multidimensional output array

Solved!
Go to solution

Hi,

 

I am a beginner in the use of malleable VIs and I can't understand how I should proceed in order to obtain malleability with regard to the output of the VI.

 

Explanation of my problem:
In this case, I use the CUDA library and I try to read a pointer located on my Device and to copy its contents in a labview array of adequate dimensions.
However, my malleable VI does not accept to output several array dimensions on the same output.
According to my tests it seems that it is because my input does not vary.
Indeed, if I separate my input cluster in two and I define the output dimension in an initialized array, it works.

 

So my question is: "Is it possible to have a malleable output (array with a variable number of dimensions) without having a "malleable" input?"

 

Working Malleable VI :

working_malleable.png

 

Not Working Malleable :

not_working_malleable.png

Main VI :

main.png

 

If you have CUDA Toolkit installed, you can run the VIs, I have provided a zip file with the differents VI.

 

 Thanks

0 Kudos
Message 1 of 6
(1,408 Views)
Solution
Accepted by topic author coco82

A malleable VI exclusively adapts to the inputs. Maybe all you need is an input where you define the output type, e.g. an empty DBL array with the desired number of dimension. (not sure what you mean by an "initialized array", it can just be a diagram constant).

 

0 Kudos
Message 2 of 6
(1,387 Views)

Maybe you could wrap the "type" (i.e. empty array of the desire dimensionality) into the data cluster?

 

altenbach_0-1659107157824.png

 

0 Kudos
Message 3 of 6
(1,365 Views)

Thank you for your answer.

It is a possibility, however my goal was to avoid it.
However, if this is not possible, then I have no choice but to use such a method.

0 Kudos
Message 4 of 6
(1,355 Views)

Type specialization happens at compile time and thus can only depend on type, not on value.

 

0 Kudos
Message 5 of 6
(1,341 Views)

BTW:

 

My suggestion of course needs some tweaks, because the multidimensional type array is empty. You need to get the size from the "actual_datatype" of the cluster of course.

 

altenbach_0-1659114777156.png

 

I am not sure if the "dst" input of your code node needs the full size or just the type, so you might still have to initialize accordingly.

 

Not sure what your typical sizes are, but note that 4x the product of all sizes can exceed I32, so I would probably do the toU64 before if this is a concern.

 

0 Kudos
Message 6 of 6
(1,336 Views)