Rewrote reductions, now much simpler than before

This commit is contained in:
jpekkila
2019-06-17 20:38:28 +03:00
parent 270ba4d562
commit ce6f453bc5
3 changed files with 174 additions and 22 deletions

View File

@@ -200,13 +200,27 @@ reduceScal(const Device device, const StreamType stream_type, const ReductionTyp
{
cudaSetDevice(device->id);
const int3 start = (int3) {device->local_config.int_params[AC_nx_min],
device->local_config.int_params[AC_ny_min],
device->local_config.int_params[AC_nz_min]
};
const int3 end = (int3) {device->local_config.int_params[AC_nx_max],
device->local_config.int_params[AC_ny_max],
device->local_config.int_params[AC_nz_max]
};
*result = reduce_scal(device->streams[stream_type], rtype,
start, end, device->vba.in[vtxbuf_handle],
device->reduce_scratchpad, device->reduce_result);
/*
*result = reduce_scal(device->streams[stream_type], rtype,
device->local_config.int_params[AC_nx],
device->local_config.int_params[AC_ny],
device->local_config.int_params[AC_nz],
device->vba.in[vtxbuf_handle],
device->reduce_scratchpad, device->reduce_result);
*/
return AC_SUCCESS;
}
@@ -220,6 +234,22 @@ reduceVec(const Device device, const StreamType stream_type,
{
cudaSetDevice(device->id);
const int3 start = (int3) {device->local_config.int_params[AC_nx_min],
device->local_config.int_params[AC_ny_min],
device->local_config.int_params[AC_nz_min]
};
const int3 end = (int3) {device->local_config.int_params[AC_nx_max],
device->local_config.int_params[AC_ny_max],
device->local_config.int_params[AC_nz_max]
};
*result = reduce_vec(device->streams[stream_type], rtype, start, end,
device->vba.in[vtxbuf0],
device->vba.in[vtxbuf1],
device->vba.in[vtxbuf2],
device->reduce_scratchpad, device->reduce_result);
/*
*result = reduce_vec(device->streams[stream_type], rtype,
device->local_config.int_params[AC_nx],
device->local_config.int_params[AC_ny],
@@ -228,7 +258,7 @@ reduceVec(const Device device, const StreamType stream_type,
device->vba.in[vtxbuf1],
device->vba.in[vtxbuf2],
device->reduce_scratchpad, device->reduce_result);
*/
return AC_SUCCESS;
}