1 /* ************************************************************************
2  * Copyright 2013 Advanced Micro Devices, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  * ************************************************************************/
16 
17 
18 #ifndef XXMV_COMMON_H_
19 #define XXMV_COMMON_H_
20 
21 #include "blas_kgen.h"
22 #include "gen_helper.h"
23 
24 /* Fetch part of vector x into tile b */
25 void
26 genFetchX(
27     struct KgenContext *ctx,
28     Tile *tile,
29     unsigned int vecLen,
30     DataType dtype,
31     const KernelVarNames *varNames,
32     TileMulFlags tflags,
33     KernelExtraFlags kflags);
34 
35 void
36 setResultPos(
37     struct KgenContext *ctx,
38     KernelExtraFlags kflags,
39     const char *axVar);
40 
41 void
42 updateResultVectorTiled(
43     struct KgenContext *ctx,
44     KernelExtraFlags kflags,
45     unsigned int vecLen,
46     Tile *tile);
47 
48 void
49 genIncPointers(
50     struct KgenContext *ctx,
51     KernelExtraFlags kflags);
52 
53 void
54 genStoreLocalResult(
55     struct KgenContext *ctx,
56     Tile *tile,
57     const char *lid);
58 
59 void
60 genAddLocalResult(
61     struct KgenContext *ctx,
62     Tile *tile,
63     const char *lid,
64     unsigned int cLocal,
65     unsigned int bStep);
66 
67 /* Store partial result to private result buffer */
68 void
69 genMergeResults(
70     struct KgenContext *ctx,
71     Tile *result,
72     Tile *source);
73 
74 #endif /* XXMV_COMMON_H_ */
75