Compare commits

..

3 Commits

4 changed files with 15 additions and 11 deletions

View File

@ -29,4 +29,7 @@ test_cublas_parallel_atrip_SOURCES = test-cublas-parallel-atrip.cxx
bin_PROGRAMS += test-cuda-sanity
test_cuda_sanity_SOURCES = test-cuda-sanity.cxx
bin_PROGRAMS += test-cublas-parallel
test_cublas_parallel_SOURCES = test-cublas-parallel.cxx
endif

View File

@ -158,8 +158,8 @@ int main(int argc, char** argv) {
MPI_Barrier(MPI_COMM_WORLD);
timings["memcpy"].start();
for (size_t _s = 0; _s < slices_d.size(); _s++) {
// for (size_t _b = 0; _b < slices_h[_s].size(); _b++) {
for (size_t _b = 0; _b < 1 ; _b++) {
for (size_t _b = 0; _b < slices_h[_s].size(); _b++) {
// for (size_t _b = 0; _b < 1 ; _b++) {
auto device = (*slices_d[_s])[_b];
auto host = slices_h[_s][_b].data();
cuMemcpyHtoD(device, host, sizes[_s]);

View File

@ -208,15 +208,14 @@ template <typename F=double>
auto dataPointer = freePointers.begin();
freePointers.erase(dataPointer);
blank.data = *dataPointer;
//
//
// TODO [#A]: do cuMemcpy of
// sources[from.source].data() ⇒ blank.data
// Do this when everything else is working.
// This will probably be a bottleneck of the H-to-D communication,
// as most slices are SelfSufficient.
//
//
WITH_CHRONO("cuda:memcpy",
WITH_CHRONO("cuda:memcpy:self-sufficient",
_CHECK_CUDA_SUCCESS("copying mpi data to device",
cuMemcpyHtoD(blank.data,
(void*)sources[from.source].data(),
sizeof(F) * sources[from.source].size()));
))
#else
blank.data = sources[from.source].data();
#endif

View File

@ -52,6 +52,8 @@ namespace atrip {
, origin_.up.data()
, 1.0);
memcpy(v.data(), toSlice.data, sizeof(F) * v.size());
#else
# pragma message("WARNING: COMPILING WITHOUT SLICING THE TENSORS")
#endif
}