implementation of smr, further optimization with tbb and gpu