Skip to content

Commit c537f75

Browse files
committed
Replaced ISAAC_IDX_TYPE with size_t where libraries expect this type
Removed warnings while building with PIConGPU
1 parent 809a408 commit c537f75

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/isaac.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ class IsaacVisualization
194194
alpaka::mem::buf::Buf< TDevAcc, isaac_float, TFraDim, ISAAC_IDX_TYPE> (
195195
alpaka::mem::buf::alloc<isaac_float, ISAAC_IDX_TYPE> (
196196
acc,
197-
alpaka::vec::Vec<TFraDim, ISAAC_IDX_TYPE> (
198-
TSource::feature_dim * (local_size[0] + 2 * ISAAC_GUARD_SIZE) * (local_size[1] + 2 * ISAAC_GUARD_SIZE) * (local_size[2] + 2 * ISAAC_GUARD_SIZE)
197+
alpaka::vec::Vec<TFraDim, ISAAC_IDX_TYPE> (ISAAC_IDX_TYPE(
198+
TSource::feature_dim * (local_size[0] + 2 * ISAAC_GUARD_SIZE) * (local_size[1] + 2 * ISAAC_GUARD_SIZE) * (local_size[2] + 2 * ISAAC_GUARD_SIZE) )
199199
)
200200
)
201201
)
@@ -715,7 +715,7 @@ class IsaacVisualization
715715
functions[i].error_code = 0;
716716
//Going from | to |...
717717
std::string source = functions[i].source;
718-
ISAAC_IDX_TYPE pos = 0;
718+
size_t pos = 0;
719719
bool again = true;
720720
int elem = 0;
721721
while (again && ((pos = source.find("|")) != std::string::npos || ((again = false) == false)) )
@@ -730,12 +730,12 @@ class IsaacVisualization
730730
//ignore " " in token
731731
token.erase(remove_if(token.begin(), token.end(), isspace), token.end());
732732
//search "(" and parse parameters
733-
ISAAC_IDX_TYPE t_begin = token.find("(");
733+
size_t t_begin = token.find("(");
734734
if (t_begin == std::string::npos)
735735
memset(&(isaac_parameter_h[i * ISAAC_MAX_FUNCTORS + elem]), 0, sizeof(isaac_float4));
736736
else
737737
{
738-
ISAAC_IDX_TYPE t_end = token.find(")");
738+
size_t t_end = token.find(")");
739739
if (t_end == std::string::npos)
740740
{
741741
functions[i].error_code = -1;
@@ -746,7 +746,7 @@ class IsaacVisualization
746746
else
747747
{
748748
std::string parameters = token.substr(t_begin+1, t_end-t_begin-1);
749-
ISAAC_IDX_TYPE p_pos = 0;
749+
size_t p_pos = 0;
750750
bool p_again = true;
751751
int p_elem = 0;
752752
isaac_float* parameter_array = (float*)&(isaac_parameter_h[i * ISAAC_MAX_FUNCTORS + elem]);
@@ -843,7 +843,7 @@ class IsaacVisualization
843843
for(next++; next != transfer_h.description[i].end(); next++)
844844
{
845845
isaac_uint width = next->first - before->first;
846-
for (ISAAC_IDX_TYPE j = 0; j < width && j + before->first < TTransfer_size; j++)
846+
for (ISAAC_IDX_TYPE j = 0; j < ISAAC_IDX_TYPE(width) && ISAAC_IDX_TYPE(j + before->first) < ISAAC_IDX_TYPE(TTransfer_size); j++)
847847
{
848848
transfer_h.pointer[i][before->first + j] = (
849849
before->second * isaac_float(width-j) +
@@ -926,7 +926,7 @@ class IsaacVisualization
926926
while (json_t* last = communicator->getLastMessage())
927927
{
928928
json_t* js;
929-
ISAAC_IDX_TYPE index;
929+
size_t index;
930930
json_t *value;
931931
//search for update requests
932932
if ( js = json_object_get(last, "request") )
@@ -1100,7 +1100,7 @@ class IsaacVisualization
11001100
}
11011101

11021102
json_t* js;
1103-
ISAAC_IDX_TYPE index;
1103+
size_t index;
11041104
json_t *value;
11051105

11061106
//search for requests for all ranks
@@ -1133,7 +1133,7 @@ class IsaacVisualization
11331133
json_array_foreach(js, index, value)
11341134
{
11351135
transfer_h.description[index].clear();
1136-
ISAAC_IDX_TYPE index_2;
1136+
size_t index_2;
11371137
json_t *element;
11381138
json_array_foreach(value, index_2, element)
11391139
{
@@ -1683,7 +1683,7 @@ class IsaacVisualization
16831683
if ( myself->send_clipping )
16841684
{
16851685
json_object_set_new( myself->json_root, "clipping", matrix = json_array() );
1686-
for (ISAAC_IDX_TYPE i = 0; i < myself->clipping.count; i++)
1686+
for (ISAAC_IDX_TYPE i = 0; i < ISAAC_IDX_TYPE(myself->clipping.count); i++)
16871687
{
16881688
json_t* f = json_object();
16891689
json_array_append_new( matrix, f );

0 commit comments

Comments
 (0)