intel: using C++11 keyword thread_local

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15087>
This commit is contained in:
Yonggang Luo 2022-06-14 01:54:44 +08:00 committed by Marge Bot
parent af0080c4ef
commit 0f3064ee44
1 changed files with 4 additions and 4 deletions

View File

@ -745,8 +745,8 @@ lookup_opcode_desc(gfx_ver *index_ver,
const struct opcode_desc *
brw_opcode_desc(const struct intel_device_info *devinfo, enum opcode opcode)
{
static __thread gfx_ver index_ver = {};
static __thread const opcode_desc *index_descs[NUM_BRW_OPCODES];
static thread_local gfx_ver index_ver = {};
static thread_local const opcode_desc *index_descs[NUM_BRW_OPCODES];
return lookup_opcode_desc(&index_ver, index_descs, ARRAY_SIZE(index_descs),
&opcode_desc::ir, devinfo, opcode);
}
@ -758,8 +758,8 @@ brw_opcode_desc(const struct intel_device_info *devinfo, enum opcode opcode)
const struct opcode_desc *
brw_opcode_desc_from_hw(const struct intel_device_info *devinfo, unsigned hw)
{
static __thread gfx_ver index_ver = {};
static __thread const opcode_desc *index_descs[128];
static thread_local gfx_ver index_ver = {};
static thread_local const opcode_desc *index_descs[128];
return lookup_opcode_desc(&index_ver, index_descs, ARRAY_SIZE(index_descs),
&opcode_desc::hw, devinfo, hw);
}