Skip to content
Snippets Groups Projects
Commit 3841dc42 authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update nvidia-hip.md

parent f1e895c3
Branches
Tags
No related merge requests found
Pipeline #29509 failed
...@@ -29,7 +29,7 @@ singularity shell /home/vic0092/rocm/centos7-nvidia-rocm.sif ...@@ -29,7 +29,7 @@ singularity shell /home/vic0092/rocm/centos7-nvidia-rocm.sif
The above gives you Singularity / apptainer shell prompt: The above gives you Singularity / apptainer shell prompt:
```console ```console
Singularity> Singularity>
``` ```
Verify that you have GPUs active and accessible on the given node: Verify that you have GPUs active and accessible on the given node:
...@@ -111,7 +111,7 @@ In this section, we show a basic code example. You can directly copy and paste t ...@@ -111,7 +111,7 @@ In this section, we show a basic code example. You can directly copy and paste t
} }
/* /*
* Square each element in the array A and write to array C. * Square each element in the array A and write to array C.
*/ */
template <typename T> template <typename T>
...@@ -144,9 +144,9 @@ int main(int argc, char *argv[]) ...@@ -144,9 +144,9 @@ int main(int argc, char *argv[])
C_h = (float*)malloc(Nbytes); C_h = (float*)malloc(Nbytes);
CHECK(C_h == 0 ? cudaErrorMemoryAllocation : cudaSuccess ); CHECK(C_h == 0 ? cudaErrorMemoryAllocation : cudaSuccess );
// Fill with Phi + i // Fill with Phi + i
for (size_t i=0; i<N; i++) for (size_t i=0; i<N; i++)
{ {
A_h[i] = 1.618f + i; A_h[i] = 1.618f + i;
} }
printf ("info: allocate device mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0); printf ("info: allocate device mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment