|  | 
| 758 | 758 |  (put-entry! pp i haddr)) | 
| 759 | 759 |  Memcpy | 
| 760 | 760 |  (memcpy-host* [this src byte-count] | 
| 761 |  | - (if (and (satisfies? CUPointer src) (device? src)) | 
|  | 761 | + (if (device? src) | 
| 762 | 762 |  (with-check (cudart/cuMemcpy (get-entry haddr 0) (cu-address* src) byte-count) this) | 
| 763 | 763 |  (cpp/memcpy! (safe (pointer src)) (extract hptr))) | 
| 764 | 764 |  this) | 
| 765 | 765 |  (memcpy-host* [this src byte-count hstream] | 
| 766 | 766 |  (with-check | 
| 767 |  | - (if (and (satisfies? CUPointer src) (device? src)) | 
|  | 767 | + (if (device? src) | 
| 768 | 768 |  (cudart/cuMemcpyAsync (get-entry haddr 0) (cu-address* src) byte-count hstream) | 
| 769 | 769 |  (cudart/cuMemcpyHtoDAsync (get-entry haddr 0) (safe (pointer src)) byte-count hstream)) | 
| 770 | 770 |  this)) | 
|  | 
| 806 | 806 |  (memcpy-host* | 
| 807 | 807 |  ([this src byte-count] | 
| 808 | 808 |  (with-check | 
| 809 |  | - (if (and (satisfies? CUPointer src) (device? src)) | 
| 810 |  | - (cudart/cuMemcpyDtoH (extract this) (cu-address* src) byte-count) | 
| 811 |  | - (cudart/cudaMemcpy (extract this) (safe (pointer src)) cudart/cudaMemcpyDefault byte-count)) | 
|  | 809 | + (if (instance? Pointer src) | 
|  | 810 | + (cudart/cudaMemcpy (extract this) (safe (pointer src)) cudart/cudaMemcpyDefault byte-count) | 
|  | 811 | + (cudart/cuMemcpyDtoH (extract this) (cu-address* src) byte-count)) | 
| 812 | 812 |  this)) | 
| 813 | 813 |  ([this src byte-count hstream] | 
| 814 | 814 |  (with-check | 
| 815 |  | - (if (and (satisfies? CUPointer src) (device? src)) | 
| 816 |  | - (cudart/cuMemcpyDtoHAsync (extract this) (cu-address* src) byte-count hstream) | 
|  | 815 | + (if (instance? Pointer src) | 
| 817 | 816 |  (cudart/cudaMemcpyAsync (extract this) (safe (pointer src)) | 
| 818 |  | - cudart/cudaMemcpyDefault byte-count hstream)) | 
|  | 817 | + cudart/cudaMemcpyDefault byte-count hstream) | 
|  | 818 | + (cudart/cuMemcpyDtoHAsync (extract this) (cu-address* src) byte-count hstream)) | 
| 819 | 819 |  this))) | 
| 820 | 820 |  (memcpy* | 
| 821 | 821 |  ([this src byte-count] | 
| 822 | 822 |  (with-check | 
| 823 |  | - (if (satisfies? CUPointer src) | 
| 824 |  | - (cudart/cuMemcpy (address (extract this)) (cu-address* src) byte-count) | 
| 825 |  | - (cudart/cudaMemcpy (extract this) (safe (pointer src)) byte-count cudart/cudaMemcpyDefault)) | 
|  | 823 | + (if (instance? Pointer src) | 
|  | 824 | + (cudart/cudaMemcpy (extract this) (safe (pointer src)) byte-count cudart/cudaMemcpyDefault) | 
|  | 825 | + (cudart/cuMemcpy (address (extract this)) (cu-address* src) byte-count)) | 
| 826 | 826 |  this)) | 
| 827 | 827 |  ([this src byte-count hstream] | 
| 828 | 828 |  (with-check | 
| 829 |  | - (if (satisfies? CUPointer src) | 
| 830 |  | - (cudart/cuMemcpyAsync (address (extract this)) (cu-address* src) byte-count hstream) | 
|  | 829 | + (if (instance? Pointer src) | 
| 831 | 830 |  (cudart/cudaMemcpyAsync (extract this) (safe (pointer src)) | 
| 832 |  | - byte-count cudart/cudaMemcpyDefault hstream)) | 
|  | 831 | + byte-count cudart/cudaMemcpyDefault hstream) | 
|  | 832 | + (cudart/cuMemcpyAsync (address (extract this)) (cu-address* src) byte-count hstream)) | 
| 833 | 833 |  this)))) | 
| 834 | 834 | 
 | 
| 835 | 835 | ;; ================== Stream Management ====================================== | 
|  | 
0 commit comments