complete the code found in openmp.c and cuda.cu, so that they perform the same algorithm described above and found inthe reference implementation (cpu.c), using OpenMP and CUDA respectively.
Budget: ₹1,500 – ₹12,500 INR
For this assignment you must complete the code found in openmp.c and cuda.cu, so that
they perform the same algorithm described above and found inthe reference implementation
(cpu.c), using OpenMP and CUDA respectively. You should not modify or create any other
files within the project. The two algorithms to be implemented are separated into 5 methods
named openmp_begin(), openmp_stage1(), openmp_stage2(), openmp_stage3(),
openmp_end() respectively (and likewise for CUDA). The begin method takes the input
image and performs any memory allocations of copies required by the algorithm. The end
method, similarly returns the output image and frees allocated memory resources.
You should implement the OpenMP and CUDA algorithms with the intention of achieving the
fastest performance for each algorithm on the hardware you use to develop and test your
assignment. As the second stage is the most advanced, it is recommended that you address
the other stages first. The starting code has helper methods, which allow you to skip and
validate the three stages individually.
It is important to free all used memory, as memory leaks could cause the benchmark mode,
which repeats the algorithm to run out of memory.
The header helper.h contains methods which can be used to skip and validate individual
stages of the assignment, to assist you with development and finding problems with the
correctness of your code. The VALIDATION pre-processor definition is defined only for Debug
builds. Each of the stage functions (for both OpenMP and CUDA) provides a place for you to
call the appropriate validation functions to check that your code is correct. As VALIDATION is
not defined for Release builds this will not affect your benchmarking performance. Note, if
you choose to use an alternative memory layout it is not necessary to use the validation
methods, however if your code does not pass the final tests, you won’t be able to achieve
per stage marks from testing.
they perform the same algorithm described above and found inthe reference implementation
(cpu.c), using OpenMP and CUDA respectively. You should not modify or create any other
files within the project. The two algorithms to be implemented are separated into 5 methods
named openmp_begin(), openmp_stage1(), openmp_stage2(), openmp_stage3(),
openmp_end() respectively (and likewise for CUDA). The begin method takes the input
image and performs any memory allocations of copies required by the algorithm. The end
method, similarly returns the output image and frees allocated memory resources.
You should implement the OpenMP and CUDA algorithms with the intention of achieving the
fastest performance for each algorithm on the hardware you use to develop and test your
assignment. As the second stage is the most advanced, it is recommended that you address
the other stages first. The starting code has helper methods, which allow you to skip and
validate the three stages individually.
It is important to free all used memory, as memory leaks could cause the benchmark mode,
which repeats the algorithm to run out of memory.
The header helper.h contains methods which can be used to skip and validate individual
stages of the assignment, to assist you with development and finding problems with the
correctness of your code. The VALIDATION pre-processor definition is defined only for Debug
builds. Each of the stage functions (for both OpenMP and CUDA) provides a place for you to
call the appropriate validation functions to check that your code is correct. As VALIDATION is
not defined for Release builds this will not affect your benchmarking performance. Note, if
you choose to use an alternative memory layout it is not necessary to use the validation
methods, however if your code does not pass the final tests, you won’t be able to achieve
per stage marks from testing.