File size: 359 Bytes
a3f2e4d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.


def make_shared_to_local_linear_layout_2d(i, j, stride=16, local_size=4):

    def shared_to_local_linear_layout_2d(i, j):
        thread_id = j + (i // local_size) * stride
        local = (i % local_size)
        return thread_id, local

    return shared_to_local_linear_layout_2d