Maybe this fits here - I’m not really sure. I did post on the Discord as well.
System requirements | Mojo has a check_gpu.mojo file that looks like this:
from gpu.host import DeviceContext
def main():
var ctx = DeviceContext()
print("GPU:", ctx.name())
However, that didn’t compile for me. The errors were clear enough and I got it working with:
from std.gpu.host import DeviceContext
def main():
try:
var ctx = DeviceContext()
print("GPU:", ctx.name())
except e:
I presume the web page is out of date with the language? If so, should this be reported somewhere (or just here) or is it worth submitting a PR with a change? (Not necessarily this specific code, but similar with the exception message perhaps; I presume there are some best practices for any examples.)