shared memory and device function demo