Skip to content

Commit 52e76b9

Browse files
committed
xe: conv: avoid stack usage for model data
1 parent 015ccb1 commit 52e76b9

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

src/gpu/intel/jit/conv/model_xehpc_common_data.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace intel {
2424
namespace jit {
2525

2626
// clang-format off
27-
const std::vector<uint64_t> &get_conv_model_xehpc_common_data() {
28-
static std::vector<uint64_t> data = {
27+
static const uint64_t _data[] = {
2928
0x000000133dcccccd, 0x4000000000000001, 0x3b80000000000043, 0x3c0000003be00000, 0x3c6000003c400000, 0x3ca000003c800000, 0x3ce000003cc00000, 0x3d1800003d000000,
3029
0x3d3000003d200000, 0x3d5000003d400000, 0x3d8000003d600000, 0x3da000003d900000, 0x3db800003dab0000, 0x3dc800003dc00000, 0x3de000003dd80000, 0x3e0000003df00000,
3130
0x3e1000003e0c0000, 0x3e2000003e1c0000, 0x3e3400003e280000, 0x3e4800003e400000, 0x3e6000003e570000, 0x3e8000003e700000, 0x3e9000003e8c0000, 0x3ea000003e980000,
@@ -13770,9 +13769,13 @@ const std::vector<uint64_t> &get_conv_model_xehpc_common_data() {
1377013769
0xc0030bbba0c090ff, 0x49a0ff10bb2a0e10, 0x0ebc0e4240ffbbdd, 0x3d04b09cff10c936, 0x16070db9b18200ff, 0xe8010710f67d0511, 0x1135ff10e3030b10, 0x08bb52b440ff3c81,
1377113770
0xbb4509f0ff10f100, 0x082d0e3acb69deff, 0x3436ff11032c0e11, 0x073c8708a8ffbadb, 0xbb674db0ff111102, 0x3a030b3bbc7d7fff, 0x27010c112c010711, 0xd8ffbc2f8bd4ff11,
1377213771
0xff1135010c3c8086, 0x4d8a4effbc5c49b8, 0x470107114c0008bd, 0xb0ffbd17edc3ff11, 0xff11550108bd990e, 0xcf49a9ffbd1f53c4, 0x00000000000000bc
13773-
};
13774-
return data;
1377513772
};
13773+
13774+
const std::vector<uint64_t> &get_conv_model_xehpc_common_data() {
13775+
static std::vector<uint64_t> data(
13776+
_data, _data + sizeof(_data) / sizeof(_data[0]));
13777+
return data;
13778+
}
1377613779
// clang-format on
1377713780

1377813781
} // namespace jit

src/gpu/intel/jit/conv/model_xehpc_dw_data.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace intel {
2424
namespace jit {
2525

2626
// clang-format off
27-
const std::vector<uint64_t> &get_conv_model_xehpc_dw_data() {
28-
static std::vector<uint64_t> data = {
27+
static const uint64_t _data[] = {
2928
0x000000133e4ccccd, 0x4000000000000001, 0x3ca8000000000051, 0x3d0500003ce00000, 0x3d2800003d1a0000, 0x3d6000003d500000, 0x3d8000003d7c0000, 0x3d9000003d8c0000,
3029
0x3da800003da00000, 0x3dd000003dc00000, 0x3de000003dd80000, 0x3dfc00003df00000, 0x3e0c00003e000000, 0x3e1800003e100000, 0x3e2800003e200000, 0x3e4000003e340000,
3130
0x3e5000003e460000, 0x3e6000003e580000, 0x3e7000003e6a0000, 0x3e8000003e7c0000, 0x3e8a00003e850000, 0x3e9000003e8c0000, 0x3e9c00003e960000, 0x3ea800003ea00000,
@@ -523,9 +522,13 @@ const std::vector<uint64_t> &get_conv_model_xehpc_dw_data() {
523522
0x04a80aff018b0002, 0xad043b98b5b3ffbc, 0x70ff019dab0401a2, 0xbbc34ad5ffbb0afb, 0x94f768ff01ab0111, 0x030b3da8ebacffbb, 0x011201d8930501f8, 0x8cff01c5000a01ca,
524523
0x397ffe28ffb9e03d, 0x862492ff01d30002, 0xb404390df4d9ff3b, 0x2eff01e5020d01ea, 0x3c394cb7ffba0a90, 0x2cdefcff01f30112, 0x040bbbcd4967ffb9, 0x8905020e0112021c,
525524
0xffbcb07e3eff0209, 0x0217b004bbeeb1ea, 0x1b21ff3b918733ff, 0x0112022e000dbacd, 0xff37d1dd9eff0229, 0x02378f05bb20b18c, 0x9854ffb91bfcf9ff, 0x000000000000399f
526-
};
527-
return data;
528525
};
526+
527+
const std::vector<uint64_t> &get_conv_model_xehpc_dw_data() {
528+
static std::vector<uint64_t> data(
529+
_data, _data + sizeof(_data) / sizeof(_data[0]));
530+
return data;
531+
}
529532
// clang-format on
530533

531534
} // namespace jit

src/gpu/intel/jit/conv/model_xehpg_common_data.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace intel {
2424
namespace jit {
2525

2626
// clang-format off
27-
const std::vector<uint64_t> &get_conv_model_xehpg_common_data() {
28-
static std::vector<uint64_t> data = {
27+
static const uint64_t _data[] = {
2928
0x000000133dcccccd, 0x3f80000000000001, 0x3b8000000000003c, 0x3c4000003c000000, 0x3ca800003c800000, 0x3ce000003cc00000, 0x3d2000003d000000, 0x3d4000003d380000,
3029
0x3d6000003d500000, 0x3d9000003d800000, 0x3daf00003da00000, 0x3dcc00003dc00000, 0x3df500003de00000, 0x3e1000003e000000, 0x3e2800003e200000, 0x3e4000003e340000,
3130
0x3e5800003e480000, 0x3e7000003e600000, 0x3e8c00003e800000, 0x3e9c00003e900000, 0x3ea800003ea00000, 0x3eba00003eb00000, 0x3ec600003ec00000, 0x3ed800003ecc0000,
@@ -14263,9 +14262,13 @@ const std::vector<uint64_t> &get_conv_model_xehpg_common_data() {
1426314262
0x59030b3be77783ff, 0xfdff3c958ccaff11, 0x0611a6b204ba8b3a, 0x1211780111118603, 0xba632e42ff117301, 0x8100073bc2340bff, 0xb3ff3b4ab8adff11, 0x0f1198b104bc4d67,
1426414263
0x3b93fdbaff119300, 0xa1360ebc28ad1aff, 0x58ff3bb33967ff11, 0x0411ca04063c5265, 0xff11b7000211bcba, 0xfa55f9ff39ff7320, 0x116cff11c5bd043b, 0x05393d84bcffbb8f,
1426514264
0xff11d7000f11dc0f, 0x89d818ffbb8c40ac, 0x4ae6ff11e5b9043a, 0x003af8fd94ffbc00
14266-
};
14267-
return data;
1426814265
};
14266+
14267+
const std::vector<uint64_t> &get_conv_model_xehpg_common_data() {
14268+
static std::vector<uint64_t> data(
14269+
_data, _data + sizeof(_data) / sizeof(_data[0]));
14270+
return data;
14271+
}
1426914272
// clang-format on
1427014273

1427114274
} // namespace jit

src/gpu/intel/jit/conv/model_xehpg_dw_data.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ namespace intel {
2424
namespace jit {
2525

2626
// clang-format off
27-
const std::vector<uint64_t> &get_conv_model_xehpg_dw_data() {
28-
static std::vector<uint64_t> data = {
27+
static const uint64_t _data[] = {
2928
0x000000133e4ccccd, 0x3f80000000000001, 0x3ce0000000000044, 0x3d4000003d200000, 0x3d7c00003d600000, 0x3da000003d8c0000, 0x3dc000003da80000, 0x3de000003dd20000,
3029
0x3dfc00003df00000, 0x3e0c00003e000000, 0x3e1c00003e100000, 0x3e2800003e200000, 0x3e4000003e340000, 0x3e5200003e480000, 0x3e7000003e600000, 0x3e8000003e7c0000,
3130
0x3e8c00003e870000, 0x3e9600003e900000, 0x3ea800003ea00000, 0x3eb400003eb00000, 0x3ec600003ec00000, 0x3ed200003ed00000, 0x3ee000003ed80000, 0x3ef000003ee40000,
@@ -521,9 +520,13 @@ const std::vector<uint64_t> &get_conv_model_xehpg_dw_data() {
521520
0x8b01123c0a3788ff, 0xf3ffba305eb9ff01, 0x1101a27904bc6b43, 0xb969806aff019d01, 0xab56053be9cb85ff, 0xc3ffbb1e411cff01, 0x0501efad0437c89b, 0x0501ca8b0501d88c,
522521
0x37b7f7a0ff01c587, 0xd301123ae2f648ff, 0x64ffba59044cff01, 0x1101ea030bbbb7f2, 0x3951e6baff01e501, 0x8fc0ff3b464b33ff, 0x89050213ae0438bf, 0xa6ff020084050205,
523522
0x3b58455affba1acd, 0xbac825ff020e0112, 0x7f05bbc87334ffba, 0xb0ff0220b6040225, 0x39ac3759ffba6701, 0x182ccbff022e8105, 0x000038377688ff3b
524-
};
525-
return data;
526523
};
524+
525+
const std::vector<uint64_t> &get_conv_model_xehpg_dw_data() {
526+
static std::vector<uint64_t> data(
527+
_data, _data + sizeof(_data) / sizeof(_data[0]));
528+
return data;
529+
}
527530
// clang-format on
528531

529532
} // namespace jit

0 commit comments

Comments
 (0)