pk@pk:~$ sudo apt install rocm-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rocm-dkms
pk@pk:~$ ./HelloWorld
Segmentation fault (core dumped)
pk@pk:~$
You appear to have skipped the steps of setting up the ROCm apt repository, and the part about installing rocm-opencl/rocm-opencl-dev. Possibly also the part about adding your user to the video group.
You can't just skip to the end of the instructions and expect it to work.