Rate This Document
Findability
Accuracy
Completeness
Readability

tensor_tiled_copy(Prefetch)

Specify the prefetch copy operation for matrices. This interface differs from tensor_tiled_copy(Trans) in its input parameters, and it uses C++ function overloading for its implementation.

The TiledCopy policy and tensor src matrix input are involved. The shape and stride of the tensor src matrix must be consistent with those defined in the TiledCopy policy.

Interface Definition

template<typename TiledCopy,

typename dtypeS, typename LayoutS>

void tensor_tiled_copy(TiledCopy copy, Tensor<dtypeS, LayoutS> src);

Template Parameters

Table 1 Template parameter definition

Parameter

Type

Description

TiledStore

typename

Copy tiling policy type.

dtypeS

typename

Src precision type.

LayoutS

typename

Src layout type.

Parameters

Table 2 Parameter definition

Parameter

Type

Description

Input/Output

copy

TiledCopy

Copy tiling policy.

Input

src

Tensor<dtypeS, LayoutS>

Source matrix for transposition.

Input

Return Value

void

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <stdlib.h>
#include "kupl_mma.h"
using namespace kupl::tensor;

int main()
{
    double *src = (double*)malloc(sizeof(double) * 8);
    auto shape_s = make_shape(Int<8>{});
    auto stride_s = make_stride(Int<1>{});
    auto layout_s = make_layout(shape_s, stride_s);
    auto tensor_s = make_tensor(src, layout_s);

    auto atom_copy_shape = make_shape(Int<1>{});
    auto tiled_copy = make_tiled_copy(Ops<KP36_PREFETCH_L1>, atom_copy_shape);

    tensor_tiled_copy(tiled_copy, tensor_s);

    free(src);
    return 0;
}

The preceding example demonstrates an L1 prefetch operation on a double-precision buffer. A single prefetch instruction processes eight double-precision data records.