[SOLVED] EE451 Assignment 7a

30.00 $

Category: Tags: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon PA7a-awcdh4.zip (141.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

1. Examples
The hello.cu contains the CUDA implementation of HelloWorld.

  1. Login to HPC
  2. Setup MPI toolchain:
  3. Compile

    nvcc -O3 -arch=sm_20 hello.cu

  4. Run

    The option -t specifies the limit of run time. Setting it as a small number will get your program scheduled earlier. For more information on srun options, you can use man srun to find out.

  5. Profile (optional)

    srun -n1 –gres=gpu:p100:1 –partition=debug nvprof ./a.out

  6. Allocate a machine

module purge
module load gcc /8.3.0 cuda /10.1.243

srun -n1 –gres=gpu:1 -t1 ./a.out

salloc -n1 –gres=gpu:1 –mem=16G -t10

// After the allocation, you will log on the machine and have 10 minutes to perform multiple operations

./a.out

// edit , compile , and run again without waiting for a new allocation

./a.out ./a.out

2. (15 points) Refer to the kernel test_shfl_up in the file simpleShfl.cu. Invoke it with a negative delta as follows:

   test_shfl_up<<<1, BDIMX>>>(d_outData, d_inData, -2);

Check the results.

  1. (15 points) Refer to the kernel test_shfl_wrap in the file simpleShfl.cu.Make a new kernel that can generate the following result:

    Initial: 0123456789101112131415 Result: 246810121416182022242628300

  2. (15 points) Refer to the kernel test_shfl_xor in the file simpleShfl.cu.Make a new kernel that can generate the following result:

    Initial: 0123456789101112131415 Result: 11559913131717212125252929

  3. (15 points) Refer to the kernel test_shfl_xor_array in the file simpleShfl.cu. Make a new kernel that just performs one operation as follows:
      value[3] = __shfl_xor(value[0], mask, BDIMX);
    

    Check the results.

  4. (20 points) Refer to the kernel test_shfl_wrap in the file simpleShfl.cu. Make a new kernel that can shift double-precision variables in a wrap-around wrap approach.
  5. (20 points) Refer to the kernel warpReduce in the file reduceIntegerShfl.cu. Write an equivalent function that uses the __shfl_down instruction instead.
  • PA7a-awcdh4.zip