Make the library compatile with different shared mem, threadsPerSM and threadsPerBlock