Open main menu

CDOT Wiki β

Changes

UnknownX

557 bytes added, 15:02, 11 April 2017
V1 -- One array
=== V1 -- One array ===
Before
int* d_pixs_x;
int* d_pixs_y;
int* d_pixs_z;
cudaMalloc((void**)&d_pixs_x, N * N * sizeof(int));
cudaMalloc((void**)&d_pixs_y, N * N * sizeof(int));
cudaMalloc((void**)&d_pixs_z, N * N * sizeof(int));
kernel_tray << <nblocks, ntpb >> >(pix_col, N, d_pixs_x, d_pixs_y, d_pixs_z);
cudaMemcpy(h_pixs_x, d_pixs_x, N * N * sizeof(int), cudaMemcpyDeviceToHost);
cudaMemcpy(h_pixs_y, d_pixs_y, N * N * sizeof(int), cudaMemcpyDeviceToHost);
cudaMemcpy(h_pixs_z, d_pixs_z, N * N * sizeof(int), cudaMemcpyDeviceToHost);
After int* d_pixs; cudaMalloc((void**)&d_pixs, N * N * 3 * sizeof(int)); kernel_tray << <nblocks, ntpb >> >(pix_col, N, d_pixs); cudaMemcpy(h_pixs, d_pixs, N * N * 3 * sizeof(int), cudaMemcpyDeviceToHost);
122
edits