Skip to content

Commit 278efbd

Browse files
Split structures into core and OCL-specific ones
Change-Id: I349ed52bcc7ed26eb0ff892acadc456ae285b92e Signed-off-by: Daria Hinz <[email protected]>
1 parent b5e2f32 commit 278efbd

10 files changed

+124
-42
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2018-2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "core/gen11/hw_cmds.h"
9+
#include "core/helpers/hw_helper.h"
10+
11+
namespace NEO {
12+
13+
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
14+
15+
typedef ICLFamily Family;
16+
static auto gfxFamily = IGFX_GEN11_CORE;
17+
18+
struct EnableCoreGen11 {
19+
EnableCoreGen11() {
20+
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
21+
}
22+
};
23+
24+
static EnableCoreGen11 enable;
25+
} // namespace NEO
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2019-2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "core/gen12lp/hw_cmds.h"
9+
#include "core/helpers/hw_helper.h"
10+
11+
namespace NEO {
12+
13+
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
14+
15+
typedef TGLLPFamily Family;
16+
static auto gfxFamily = IGFX_GEN12LP_CORE;
17+
18+
struct EnableCoreGen12LP {
19+
EnableCoreGen12LP() {
20+
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
21+
}
22+
};
23+
24+
static EnableCoreGen12LP enable;
25+
} // namespace NEO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2017-2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "core/gen8/hw_cmds.h"
9+
#include "core/helpers/hw_helper.h"
10+
11+
#include <type_traits>
12+
13+
namespace NEO {
14+
15+
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
16+
17+
typedef BDWFamily Family;
18+
static const auto gfxFamily = IGFX_GEN8_CORE;
19+
20+
struct EnableCoreGen8 {
21+
EnableCoreGen8() {
22+
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
23+
}
24+
};
25+
26+
static EnableCoreGen8 enable;
27+
} // namespace NEO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2017-2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "core/gen8/hw_cmds.h"
9+
#include "core/helpers/hw_helper.h"
10+
11+
#include <type_traits>
12+
13+
namespace NEO {
14+
15+
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
16+
17+
typedef SKLFamily Family;
18+
static const auto gfxFamily = IGFX_GEN9_CORE;
19+
20+
struct EnableCoreGen9 {
21+
EnableCoreGen9() {
22+
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
23+
}
24+
};
25+
26+
static EnableCoreGen9 enable;
27+
} // namespace NEO

runtime/enable_gens.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ macro(macro_for_each_gen)
117117
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_WINDOWS ${GENX_PREFIX}/windows/hw_info_config_${GEN_TYPE_LOWER}.cpp)
118118
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_LINUX ${GENX_PREFIX}/linux/hw_info_config_${GEN_TYPE_LOWER}.cpp)
119119

120-
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${GENX_PREFIX}/enable_family_full_${GEN_TYPE_LOWER}.cpp)
120+
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${GENX_PREFIX}/enable_family_full_ocl_${GEN_TYPE_LOWER}.cpp)
121+
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_family_full_core_${GEN_TYPE_LOWER}.cpp)
121122
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_hw_info_config_${GEN_TYPE_LOWER}.cpp)
122123
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${CORE_GENX_PREFIX}/enable_${GEN_TYPE_LOWER}.cpp)
123124

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/*
2-
* Copyright (C) 2018-2019 Intel Corporation
2+
* Copyright (C) 2018-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "core/gen11/hw_cmds.h"
98
#include "runtime/command_queue/command_queue_hw.h"
109
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
1110
#include "runtime/command_stream/command_stream_receiver_hw.h"
@@ -15,20 +14,16 @@
1514
#ifdef HAVE_INSTRUMENTATION
1615
#include "runtime/event/perf_counter.h"
1716
#endif
18-
#include "core/helpers/hw_helper.h"
1917
#include "runtime/mem_obj/buffer.h"
2018
#include "runtime/mem_obj/image.h"
2119
#include "runtime/sampler/sampler.h"
2220

2321
namespace NEO {
2422

25-
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
26-
2723
typedef ICLFamily Family;
28-
static auto gfxFamily = IGFX_GEN11_CORE;
2924

30-
struct EnableGen11 {
31-
EnableGen11() {
25+
struct EnableOCLGen11 {
26+
EnableOCLGen11() {
3227
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
3328
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
3429
populateFactoryTable<CommandQueueHw<Family>>();
@@ -37,9 +32,8 @@ struct EnableGen11 {
3732
populateFactoryTable<BufferHw<Family>>();
3833
populateFactoryTable<ImageHw<Family>>();
3934
populateFactoryTable<SamplerHw<Family>>();
40-
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
4135
}
4236
};
4337

44-
static EnableGen11 enable;
38+
static EnableOCLGen11 enable;
4539
} // namespace NEO
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/*
2-
* Copyright (C) 2019 Intel Corporation
2+
* Copyright (C) 2019-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "core/gen12lp/hw_cmds.h"
9-
#include "core/helpers/hw_helper.h"
108
#include "runtime/command_queue/command_queue_hw.h"
119
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
1210
#include "runtime/command_stream/command_stream_receiver_hw.h"
@@ -18,13 +16,10 @@
1816

1917
namespace NEO {
2018

21-
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
22-
2319
typedef TGLLPFamily Family;
24-
static auto gfxFamily = IGFX_GEN12LP_CORE;
2520

26-
struct EnableGen12LP {
27-
EnableGen12LP() {
21+
struct EnableOCLGen12LP {
22+
EnableOCLGen12LP() {
2823
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
2924
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
3025
populateFactoryTable<CommandQueueHw<Family>>();
@@ -33,9 +28,8 @@ struct EnableGen12LP {
3328
populateFactoryTable<BufferHw<Family>>();
3429
populateFactoryTable<ImageHw<Family>>();
3530
populateFactoryTable<SamplerHw<Family>>();
36-
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
3731
}
3832
};
3933

40-
static EnableGen12LP enable;
34+
static EnableOCLGen12LP enable;
4135
} // namespace NEO
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "core/gen8/hw_cmds.h"
9-
#include "core/helpers/hw_helper.h"
108
#include "runtime/command_queue/command_queue_hw.h"
119
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
1210
#include "runtime/command_stream/command_stream_receiver_hw.h"
@@ -21,13 +19,10 @@
2119

2220
namespace NEO {
2321

24-
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
25-
2622
typedef BDWFamily Family;
27-
static const auto gfxFamily = IGFX_GEN8_CORE;
2823

29-
struct EnableGen8 {
30-
EnableGen8() {
24+
struct EnableOCLGen8 {
25+
EnableOCLGen8() {
3126
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
3227
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
3328
populateFactoryTable<CommandQueueHw<Family>>();
@@ -36,9 +31,8 @@ struct EnableGen8 {
3631
populateFactoryTable<BufferHw<Family>>();
3732
populateFactoryTable<ImageHw<Family>>();
3833
populateFactoryTable<SamplerHw<Family>>();
39-
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
4034
}
4135
};
4236

43-
static EnableGen8 enable;
37+
static EnableOCLGen8 enable;
4438
} // namespace NEO
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "core/gen8/hw_cmds.h"
9-
#include "core/helpers/hw_helper.h"
108
#include "runtime/command_queue/command_queue_hw.h"
119
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
1210
#include "runtime/command_stream/command_stream_receiver_hw.h"
@@ -21,13 +19,10 @@
2119

2220
namespace NEO {
2321

24-
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
25-
2622
typedef SKLFamily Family;
27-
static const auto gfxFamily = IGFX_GEN9_CORE;
2823

29-
struct EnableGen9 {
30-
EnableGen9() {
24+
struct EnableOCLGen9 {
25+
EnableOCLGen9() {
3126
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
3227
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
3328
populateFactoryTable<CommandQueueHw<Family>>();
@@ -36,9 +31,8 @@ struct EnableGen9 {
3631
populateFactoryTable<BufferHw<Family>>();
3732
populateFactoryTable<ImageHw<Family>>();
3833
populateFactoryTable<SamplerHw<Family>>();
39-
hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get();
4034
}
4135
};
4236

43-
static EnableGen9 enable;
37+
static EnableOCLGen9 enable;
4438
} // namespace NEO

unit_tests/libult/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ macro(macro_for_each_gen)
1010
${NEO_SOURCE_DIR}/core/unit_tests/libult/${GEN_TYPE_LOWER}.cpp
1111
${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_hw_info_config_${GEN_TYPE_LOWER}.cpp
1212
${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_${GEN_TYPE_LOWER}.cpp
13-
${NEO_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/enable_family_full_${GEN_TYPE_LOWER}.cpp
13+
${NEO_SOURCE_DIR}/core/${GEN_TYPE_LOWER}/enable_family_full_core_${GEN_TYPE_LOWER}.cpp
14+
${NEO_SOURCE_DIR}/runtime/${GEN_TYPE_LOWER}/enable_family_full_ocl_${GEN_TYPE_LOWER}.cpp
1415
)
1516

1617
if(EXISTS "${NEO_SOURCE_DIR}/core/unit_tests/${GEN_TYPE_LOWER}/cmd_parse${BRANCH_DIR_SUFFIX}/cmd_parse_${GEN_TYPE_LOWER}.inl")

0 commit comments

Comments
 (0)