Hox to create a 4 dimensionnality buffer ??

hi,
I need help to create a buffer with 4 dimensions,
I use a dynamic table with 4 dimensions as sources float**** RdhS_ExpMTot_mat4D
RdhS_ExpMTot_mat4D is initialized before the buffer is created.

//BUFFER RdhS_ExpMTot_mat4D
optix::Buffer RdhS_ExpMTot_mat4D_buffer=_context->createBuffer(RT_BUFFER_INPUT);
RdhS_ExpMTot_mat4D_buffer->setFormat(RT_FORMAT_FLOAT);
RTsize dims={NPtetI+1,NLMX+1,NbECH+1,NGbmx+1};
RdhS_ExpMTot_mat4D_buffer->setSize(4,dims);
memcpy(RdhS_ExpMTot_mat4D_buffer->map(), RdhS_ExpMTot_mat4D, ((NPtetI+1)
(NLMX+1)(NbECH+1) NGbmx+1) * sizeof(float)));
cout<<“OK”<<endl;
RdhS_ExpMTot_mat4D_buffer->unmap();
_context[“RdhS_ExpMTot_mat4D”]->setBuffer(RdhS_ExpMTot_mat4D_buffer);

but it don’t works, the program crash… and i dont see the “ok” i think it’s the memcopy which doesn’t work

There simply are no 4D buffers.

rtBufferSetSizev() won’t handle more than three dimensions, it’s just another way to call rtBufferSetSize1D, rtBufferSetSize2D, or rtBufferSetSize3D.

If you check the API error return values correctly you should see an exception
“Illegal buffer dimensionality: 4” when calling buffer->setSize(4, *dims);

you are right thanks !! i’d an error in my code, should be RdhS_ExpMTot_mat4D_buffer->setSize(4,dims); instead of RdhS_ExpMTot_mat4D_buffer->setSize(4,*dims); abd now i’ve “Illegal buffer dimensionality: 4” when calling buffer->setSize(4, dims);