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 #ifndef SUBGROUP_H
18 #define SUBGROUP_H
19 
20 #include <clBLAS.h>
21 
22 #include <cltypes.h>
23 #include <kerngen.h>
24 #include <mempat.h>
25 #include <dblock_kgen.h>
26 
27 #include <blas_funcs.h>
28 #include <matrix_props.h>
29 #include "blas_kgen.h"
30 
31 #include "tile.h"
32 #include "fetch.h"
33 
34 typedef int
35 (*UpresProcPtr)( struct KgenContext*,
36     BlasFunctionID,
37     const BlasGenSettings *,
38     UpdateResultFlags,
39     const char *,
40     const char *,
41     const char *);
42 
43 /**
44 */
45 typedef struct SubgVarNames {
46 
47     const char* subgCoord;  // 2-vector of subgroup ID by X and Y
48     const char* itemId;     // 2-vector of subgroup item id/subgroupID
49 } SubgVarNames;
50 
51 /**
52 */
53 int
54 mergeUpdateResult( struct KgenContext* pCtx,
55     BlasFunctionID funcID,
56     struct BlasGenSettings* pGSet,
57     SubgVarNames* pSubgVNames,
58     UpdateResultFlags upResFlags,
59     UpresProcPtr upresProcPtr );
60 
61 /**
62 */
63 int
64 subgGetDefaultDecomp(
65     PGranularity *pgran,
66     SubproblemDim *subdims,
67     void* pArgs );
68 
69 #endif
70