-
Notifications
You must be signed in to change notification settings - Fork 63
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
Request: Vector of Ptr<Float> as parameter #69
Comments
Ok, I see that it is "half done". The parameter passing code is there in Kernel.h, but the associated mkArg is not, resulting in a linking error. Would really appreciate this looked upon :) |
@mn416 thoughts on this ? |
Hi @robiwano, I agree, this is a desirable feature. There seem to be two possible approaches:
As you say, it looks like (1) is half done. You could try adding template <> inline Ptr<Ptr<Float>> mkArg< Ptr<Ptr<Float>> >() {
Ptr<Ptr<Float>> x;
x = getUniformPtr<Ptr<Float>>();
return x;
} to SharedArray<float> floatsA(256);
SharedArray<float> floatsB(256);
SharedArray<float*> floatPointers(16);
floatPointers[0] = floatsA.getPointer();
floatPointers[1] = floatsB.getPointer();
|
Yes, I already tried that and it does make it link, however, the emulator crashes on an access violation, this is the test kernel:
and crash is in Emulator.cpp:
it seems the s->dmaLoad.addr.intVal has an invalid value. |
Thanks for the debug info. The T* getPointer() {
return (T*) &emuHeap[address];
} I think it should be: T* getPointer() {
return (T*) address;
} Of course, the return value should never actually be dereferenced on the ARM side, only inside a kernel. I don't think I rely on the current |
Correction, I think it's: T* getPointer() {
return (T*) (address*4);
} |
You mean the same impl as for getAddress() ? |
Ok, that seems to work in the emulator! Tonight I'll be able to try on the Pi zero. |
Hmm... I seem to get a crash when doing gather/receive, my test kernel accumulates input vectors into an output vector:
Setting USE_GATHER_RECEIVE to 0 yields correct output result, but setting it to 1 induces an access violation in Emulator.cpp:
|
In order to run an algorithm on batches of vectors, I'd like to be able to send a vector of pointers to arrays. Example:
Possible ?
The text was updated successfully, but these errors were encountered: