Fix build with SHARED_LOWLEVEL=0 and USE_CUDA=0

Trivial fix that adds missing guards.