Skip to content

Commit 7a7bb50

Browse files
Fix queue casts which cause spirv to die with assert
Fixes: intel/opencl-clang#46 This fixes ocloc build of scheduler.cl which dies with assert from spirv: SPIRV-LLVM-Translator/lib/SPIRV/SPIRVWriter.cpp:685 Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> #143 Change-Id: I5c9d4a75321008802b9d77ef4a6bad3812e1b8b4
1 parent 13f9f3a commit 7a7bb50

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

runtime/scheduler/scheduler.cl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -155,18 +155,18 @@ __global IGIL_KernelData* IGIL_GetKernelData( __global IGIL_KernelDataHeader* pK
155155
}
156156

157157

158-
inline __global IGIL_CommandHeader* TEMP_IGIL_GetCommandHeader( queue_t q, uint offset )
158+
inline __global IGIL_CommandHeader* TEMP_IGIL_GetCommandHeader( __global IGIL_CommandQueue* q, uint offset )
159159
{
160-
__global uchar *pQueueRaw = __builtin_astype( q, __global uchar* );
160+
__global uchar *pQueueRaw = (__global uchar *) q;
161161

162162
__global IGIL_CommandHeader* pCommand = ( __global IGIL_CommandHeader* )( pQueueRaw + offset );
163163

164164
return pCommand;
165165
}
166166
//Make sure enough command packets are in command queue before calling this function.
167-
__global IGIL_CommandHeader* TEMP_IGIL_GetNthCommandHeader( queue_t q, uint initialOffset, uint number )
167+
__global IGIL_CommandHeader* TEMP_IGIL_GetNthCommandHeader( __global IGIL_CommandQueue* q, uint initialOffset, uint number )
168168
{
169-
__global uchar *pQueueRaw = __builtin_astype( q, __global uchar* );
169+
__global uchar *pQueueRaw = (__global uchar *) q;
170170

171171
__global IGIL_CommandHeader* pCommand = ( __global IGIL_CommandHeader* )( pQueueRaw + initialOffset );
172172
uint Offset = initialOffset;
@@ -182,9 +182,9 @@ __global IGIL_CommandHeader* TEMP_IGIL_GetNthCommandHeader( queue_t q, uint init
182182
}
183183

184184
//Make sure enough command packets are in command queue before calling this function.
185-
uint TEMP_IGIL_GetNthCommandHeaderOffset( queue_t q, uint initialOffset, uint number )
185+
uint TEMP_IGIL_GetNthCommandHeaderOffset( __global IGIL_CommandQueue* q, uint initialOffset, uint number )
186186
{
187-
__global uchar *pQueueRaw = __builtin_astype( q, __global uchar* );
187+
__global uchar *pQueueRaw = (__global uchar *) q;
188188

189189
__global IGIL_CommandHeader* pCommand = ( __global IGIL_CommandHeader* )( pQueueRaw + initialOffset );
190190
uint Offset = initialOffset;
@@ -2878,13 +2878,13 @@ void SchedulerParallel20(
28782878
{
28792879
if( CurrentPacket == GroupID )
28802880
{
2881-
offset = TEMP_IGIL_GetNthCommandHeaderOffset( __builtin_astype( pQueue, queue_t ), InitialOffset, CurrentPacket );
2881+
offset = TEMP_IGIL_GetNthCommandHeaderOffset( pQueue, InitialOffset, CurrentPacket );
28822882
}
28832883
else
28842884
{
2885-
offset = TEMP_IGIL_GetNthCommandHeaderOffset( __builtin_astype( pQueue, queue_t ), offset, get_num_groups( 0 ) );
2885+
offset = TEMP_IGIL_GetNthCommandHeaderOffset( pQueue, offset, get_num_groups( 0 ) );
28862886
}
2887-
pCommand = TEMP_IGIL_GetCommandHeader( __builtin_astype( pQueue, queue_t ), offset );
2887+
pCommand = TEMP_IGIL_GetCommandHeader( pQueue, offset );
28882888

28892889
//Initialize command packet with proper lws
28902890
if( get_local_id( 0 ) == 0 )

0 commit comments

Comments
 (0)