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

Missing built-in mad_hi #11

Open
profmaad opened this issue Apr 6, 2014 · 5 comments
Open

Missing built-in mad_hi #11

profmaad opened this issue Apr 6, 2014 · 5 comments

Comments

@profmaad
Copy link

profmaad commented Apr 6, 2014

Hi,

I'm currently trying to get any kind of PRNG to compile via COPRTHR, but so far I am having absolutely no luck.

Specifically, I am trying to get this to work: http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-mwc64x.html
The problem I am facing at the moment is the following:

/mwc64x/mwc64x_rng.cl:23:33: error: ‘mad_hi’ was not declared in this scope
  uint Cn=mad_hi(MWC64X_A,X,carry);  

It appears that neither mad_hi nor mul_hi are defined when I try to compile this in an OpenCL kernel via clcc.

@browndeer
Copy link
Owner

What platform are you using/targeting?

DAR

Prof. MAAD wrote:

Hi,

I'm currently trying to get any kind of PRNG to compile via COPRTHR, but
so far I am having absolutely no luck.

Specifically, I am trying to get this to work:
http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-mwc64x.html
The problem I am facing at the moment is the following:

|/mwc64x/mwc64x_rng.cl:23:33: error: ‘mad_hi’ was not declared in this scope
uint Cn=mad_hi(MWC64X_A,X,carry);
|

It appears that neither mad_hi nor mul_hi are defined when I try to
compile this in an OpenCL kernel via clcc.


Reply to this email directly or view it on GitHub
#11.

David Richie, Ph.D.
Brown Deer Technology
1641 Denwright Court
Forest Hill, MD 21050
410-459-3848
drichie@browndeertechnology.com
www.browndeertechnology.com

@profmaad
Copy link
Author

profmaad commented Apr 6, 2014

I'm currently testing with the COPRTHR backend on a core i7. The ultimate target is going to be the parallella, though.

COPRTHR version is 1.6.0.

I've got it working, by now. I had to add my own implementation of mad_hi and had to transform a lot of OpenCL vector initializers of the form

uint2 val = (uint2)(x,y);

to

uint2 val;
val.x = x;
val.y = y;

@browndeer
Copy link
Owner

This is not a complete solution, but rather a quick fix you can use to keep going.

#define mad_hi(a,b,c) ((unsigned int)(((unsigned long long)a*b)>>32)+c)

On x86 this is what that function is going to be. Same for Epiphany.

We can add this and related wrappers into the next update.

Please let me know if you have any questions or if this still presents an issue.

Prof. MAAD wrote:

I'm currently testing with the COPRTHR backend on a core i7. The
ultimate target is going to be the parallella, though.

COPRTHR version is 1.6.0.


Reply to this email directly or view it on GitHub
#11 (comment).

David Richie, Ph.D.
Brown Deer Technology
1641 Denwright Court
Forest Hill, MD 21050
410-459-3848
drichie@browndeertechnology.com
www.browndeertechnology.com

@profmaad
Copy link
Author

profmaad commented Apr 8, 2014

Thanks, that Is pretty much what I did, except I put it in a function.

What would be nice would be an overview of the state of standards compliance of COPRTHR for the current OpenCL versions.
It's kind of hard trying to code to a standard with a library, when I don't know how much of the standard the library implements.

@browndeer
Copy link
Owner

Such a document exists. Let me try to track it down. It used to be posted with the other information.

We will try to add these related functions, mad_hi(), etc., to the 1.6 branch for next update release.

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

2 participants