Compute the dot product of two float vectors on the GPU: .
Complete both functions in the starter:
__global__ void dot_kernel(const float* a, const float* b, float* out, int n): each thread loads one product a[tid] * b[tid] (threads with tid >= n contribute 0) into shared memory; a tree reduction sums the block and thread 0 writes the total to out[0].float dot_product(const std::vector<float>& a, const std::vector<float>& b): the host entry point the tests call. Copy a and b to the device, launch dot_kernel with a single block of 256 threads, copy out[0] back and return it as a float. Return 0.0f for empty vectors.Assumptions: a.size() == b.size() == n and n <= 256. The tests print the returned value with std::cout, e.g. 32 for [1, 2, 3] · [4, 5, 6].