26
edits
Changes
Group 6
,→Assignment 2 - Parallelize
=== Assignment 2 - Parallelize ===
Serial Code:
----
<pre>
void calculatePI(int n, float* h_a) {
float x, y;
Parallel code:
<pre>
__global__ void setRng(curandState *rng) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
d_a[idx] = 4.0 * (float(d_a[idx])) / float(n);
}
</pre>
=== Assignment 3 - Optimize ===