add shared memory check for all kernels