- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi,
I have the following code that works well :
#pragma unrollfor(uint i = 0; i < MLT_SAMPLING_TASK_PER_SAMPLER; i++, taskId++){clTask task = tasks[taskId];clMLTSample sample = task.mltSample;if (sample.requestNewMLTSample && sample.score > bestScore){bestScore = sample.score;bestScoreTaskId = taskId;}}#pragma unroll for(uint i = 0; i < MLT_SAMPLING_TASK_PER_SAMPLER; i++, taskId++) { clTask task = tasks[taskId]; clMLTSample sample = task.mltSample; if (sample.requestNewMLTSample && sample.score > bestScore) { bestScore = sample.score; bestScoreTaskId = taskId; } }
But when I replace 2 lines with (to minimize the memory access) I got an access violation !
clMLTSample sample = tasks[taskId].mltSample;
Ссылка скопирована
10 Ответы
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Is this OpenCL or Host code? From the looks of it it looks like a host code so it has nothing to do with Intel OpenCL SDK.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
No, it is OpenCL kernel code !!!!
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
No reaction from the Intel Team ?
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hello,
I'm not sure it's legal to use #pragma unroll in OpenCL C code. Does the problem persist when you remove those instructions?
Doron Singer
I'm not sure it's legal to use #pragma unroll in OpenCL C code. Does the problem persist when you remove those instructions?
Doron Singer
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
It is something that I have found on the Intel pages... so at least for the Intel SDK it should work.
Anyway, I have test without... and I still have the crash :-(
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Good. Next question: What is a "clTask"? Is it a typedef to an OpenCL native type, or is it some user-defined struct?
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
clTask is a typedef to a struct.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
I'm not sure the assignment operator is defined for structs in C. You can use the printf extension to make sure the struct doesn't contain garbage data after the assignment.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Assignment operation for structs is very much defined in C (http://en.wikipedia.org/wiki/Struct_%28C_programming_language%29#Assignment).
These 2 pieces of code are identical in their functionality for a good compiler. Lazy compiler might allocate space from stack for clTask task but those days are long gone.
These 2 pieces of code are identical in their functionality for a good compiler. Lazy compiler might allocate space from stack for clTask task but those days are long gone.
clTask task = tasks[taskId];
clMLTSample sample = task.mltSample;
clMLTSample sample = tasks[taskId].mltSample;
If the only difference between working and non working version are those pieces of code then this indeed is a bug in Intel's implementation.
clMLTSample sample = tasks[taskId].mltSample;
If the only difference between working and non working version are those pieces of code then this indeed is a bug in Intel's implementation.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
In that case, we'll look into this.
Thanks for reporting (in case it's not obvious from my posts, I'm not on the compiler side of things :))
Doron
Thanks for reporting (in case it's not obvious from my posts, I'm not on the compiler side of things :))
Doron

Ответить
Параметры темы
- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати