Page MenuHome

Syntax error while compilation OpenCL kernels (Cycles Render Engine): used type 'float' where floating point type is not allowed.
Closed, ResolvedPublic

Description

System Information
Windows 7-10, AMD Radeon(TM) R7 Graphics (Spectre)

Blender Version
Broken: 2.76b f337fea
Worked: 2.72b - the last working

Short description of error
Error while compilation OpenCL kernels (Cycles Render Engine).
util_math.h:556:12: error: used type 'float' where floating point type is not allowed

return (t)? a/t: a;

OpenCL v1.1 s6.3.i says the condition cannot be a floating point type. C99 stands the same.

The correct Ternary Operator should be as follows:

return (t != 0.0f)? a/t: a;

Exact steps for others to reproduce the error
1 option.
Compile Blender's Cycles OpenCL kernels by LLVM's clang.

2 option.
2.1. set GPU_HSAIL_ENABLE=1
2.2. Run Blender on AMD Radeon(TM) R7 Graphics; Spectre (CI-based or newer GPU) with the latest AMD drivers installed.
2.3. Select OpenCL as a Compute Device under "User Preferences".
2.4. Select "Cycles Render" as an Engine.
2.5. Select "GPU Compute" as a Device for rendering.
2.5. Render any image or animation.

Blender first of all will try to compile OpenCL kernels and the error will be reported.