Open main menu

CDOT Wiki β

Changes

Group 6

12 bytes added, 21:11, 7 April 2019
Assignment 2 - Parallelize
=== Assignment 2 - Parallelize ===
Serial Code:
----
<pre>
Serial Code:
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 ===
26
edits