Skip to content

Commit

Permalink
Merge pull request #137 from scchan/multigpu_copy
Browse files Browse the repository at this point in the history
fix array copy on multi-gpu system
  • Loading branch information
whchung authored Oct 4, 2016
2 parents 5d94e3d + 3b5409c commit 1ffc09d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/kalmar_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,11 @@ static inline void copy_helper(std::shared_ptr<KalmarQueue>& srcQueue, void* src
/// If device pointer comes from cpu, let the device queue to handle the copy
/// For example, if src is on cpu and dst is on device,
/// in OpenCL, clEnqueueWrtieBuffer to write data from src to device
if (is_cpu_queue(srcQueue))
dstQueue->write(dst, (char*)src + src_offset, cnt, dst_offset, block);
else if (is_cpu_queue(dstQueue))

if (is_cpu_queue(dstQueue))
srcQueue->read(src, (char*)dst + dst_offset, cnt, src_offset);
else
dstQueue->copy(src, dst, cnt, src_offset, dst_offset, block);
dstQueue->write(dst, (char*)src + src_offset, cnt, dst_offset, block);
}

/// software MSI protocol
Expand Down

0 comments on commit 1ffc09d

Please sign in to comment.