TP 0.2 - Host view of kernel computations
Sept. 2020
You should complete this part within 30 minutes.
In this exercise your will have to prepare a device buffer and launch some kernels to change its content. Then, you will copy the device buffer to the host for inspection.
Read and edit the file 1-1d_kernel_calls.cu from the student resources archive student_resources.tar.gz.
You have to write the code for the kernel in the main() function. You are expected to insert your code in the sections demarcated with //@@. You should not have to make any change in other code sections. In particular, you do not have to write kernels yet: we already coded them and they are available in the kernels.o object file. The documentation / API of the kernels in provided in the kernel.h header.
Running make test-1-1d_kernel_calls should build and run your program. The integrated test should succeed.
cudaMalloc() API documentationcudaMemcpy() API documentationcudaFree() API documentationIn this exercise your will have to prepare a device buffer and launch some kernels to change its content. Then, you will copy the device buffer to the host for inspection.
Read and edit the file 2-2d_kernel_calls.cu from the student resources archive student_resources.tar.gz.
You have to write the code for the kernel in the main() function. You are expected to insert your code in the sections demarcated with //@@. You should not have to make any change in other code sections. In particular, you do not have to write kernels yet: we already coded them and they are available in the kernels.o object file. The documentation / API of the kernels in provided in the kernel.h header.
Running make test-2-2d_kernel_calls should build and run your program. The integrated test should succeed.
cudaMallocPitch() API documentationcudaMemcpy2D() API documentationcudaFree() API documentation