gpu: only use shared memory if kernel will be mapped to more than one thread