Skip to content

Accessing strided array without copying #1468

Open
@odarbs

Description

@odarbs

I have setup a simple uniform mesh of a cube and am trying to associate a strided array with a field using set_external, the data layout is an array of structures of 5 floats and I believe I can pass that information to the conduit node by giving it the offset, stride and size of the element all in bytes:

mesh["fields/V/values"].set_external(cellData.device, numCells, 1 * sizeof(float), 5 * sizeof(float), sizeof(float));

when I pass the host side pointer I get the following error:

Execution failed with vtkm: Could not find appropriate cast for array in CastAndCall.
Array: valueType=float storageType=vtkm::cont::StorageTagStride 16777216 values occupying 67108864 bytes [1 1 1 ... 1 1 1]
TypeList: vtkm::List<float, double>

when I pass the device side pointer I get a seg fault.

If I don't pass any of the offset and stride information everything works and I can generate a plot of the field, it's just stripy! Is this type of AoS data layout supported or do I need to take a different approach?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions