OpenCALTeam / opencal

OpenCAL, the Open Computing Abstraction Layer Domain Specific Language for Structured Grid Meshes
GNU Lesser General Public License v3.0
13 stars 1 forks source link

[OPENCAL-OMP] - memset #23

Closed knotman90 closed 8 years ago

knotman90 commented 8 years ago

This produces a wrong initialization on the substate unless its type size is 1 byte. File: https://github.com/OpenCALTeam/opencal/blob/master/OpenCAL-OMP/source/cal2DBuffer.c at line 230.

void calSetBuffer2Di(CALint* M, int rows, int columns, CALint value) { memset(M, value, sizeof(CALint)_rows_columns); }

knotman90 commented 8 years ago

Same Problem in 3D version https://github.com/OpenCALTeam/opencal/blob/master/OpenCAL-OMP/source/cal3DBuffer.c

Fix using:

const int size = rows * columns * slices; int i; for (i=0; i<size; i++) M[i] = value;