Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small problem causes “call to 'select' is ambiguous” in all level set examples #36

Open
metorm opened this issue Sep 29, 2017 · 2 comments

Comments

@metorm
Copy link
Contributor

metorm commented Sep 29, 2017

I am testing the level set examples provided with the source.
However, all level set examples: levelSetBasic levelSetFacetedGrowth levelSetNormalGrowth gives run time error:

			BUILD LOG
 ************************************************
<kernel>:239:10: error: call to 'select' is ambiguous
        (pv_f64=select((pv_f64/1.8000000000000000444), (pv_f64/(1. - pv_f64)), (pv_f64*pv_f4<0)));
                ^~~~~~
cl_kernel.h:16067:23: note: candidate function
int __OVERLOADABLE__  select(int a, int b, int c);
                      ^
cl_kernel.h:16073:24: note: candidate function
uint __OVERLOADABLE__  select(uint a, uint b, int c);
                       ^
[below is all those overload versions of the select function]

and the kernel source being compiled is:

			KERNEL SOURCE CODE
 ------------------------------------------------
#pragma OPENCL EXTENSION cl_khr_fp64 : disable

__kernel void compute_1(__global float *a_f2,
                        __global float *a_f1)
{
	uint index = get_glterminate called after throwing an instance of 'std::logic_error'
obal_id(0);
	float pv_f4;
	float pv_f9;

...

	(pv_f64=select((pv_f64/1.8000000000000000444), (pv_f64/(1. - pv_f64)), (pv_f64*pv_f4<0)));
	a_f2[(index+10507)] = select((float)(pv_f64), (float)(sign(pv_f4)), (int)(((pv_f65+pv_f67)<0.10000000000000000555)));
}
 ------------------------------------------------

it seems that in the last line, pv_f64=select((pv_f64/1.8000000000000000444), (pv_f64/(1. - pv_f64)), (pv_f64*pv_f4<0)), a type indicator is requird.
I believe this is easy to fix, but I don't know where to find the code which generated the above OpenCL kernel. I am new to ASL yet.
Someone please fix this or tell me where to start to fix this?

@metorm
Copy link
Contributor Author

metorm commented Sep 29, 2017

Environment:
manjaro linux
NVIDIA opencl implementation
gcc-7

@metorm
Copy link
Contributor Author

metorm commented Sep 29, 2017

I solved the problem by myself.
See #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant