Question 4 {20 points): You developed a serial algorithm to combine N integers stored in an array, X, into a single inte
Posted: Sun May 15, 2022 2:00 pm
Question 4 {20 points): You developed a serial algorithm to combine N integers stored in an array, X, into a single integer: y. == y = X10]; forli 1; i < N; i++) { y = y + x + y*x; } = The operationena O b = a + b + axb, is invoked in every iteration. As you can see, this operation is commutative and associative. This means that you may apply this operation recursively to pairs of numbers in a list in any order and still obtain the correct result. Now you need to accelerate this serial algorithm by off-loading most of its computation to GPU. The remaining computation can be finished off in the CPU. Please implement the kernel function below. Create any variable that you need to use in the kernel function or assume that they have been created elsewhere for you. Please pay attention to properly handling the boundary conditions in the kernel function