[Scilab-Dev] Problem using double API

Vincent Lejeune vincent.lejeune at u-psud.fr
Thu Nov 5 12:43:07 CET 2009



Sorry, this was a copy/paste failure : the code actually contains the
following lines :


rowsB=rowsA;
colsB=colsA;

(in fact thereal code is here :
http://gitweb.scilab.org/?p=cuda;a=blob;f=simd/sci_gateway/c/sci_simd.c;h=d480c8071070ae5596e1bde42babfc862a2f1620;hb=HEAD
but it did not work either, but using sciprint I can see that the value
returned by gpuCompute is the right one)

Le Jeu 5 novembre 2009
09:44, Yann Collette a écrit : 
> And what about this: the
value of rowsB and colsB is not defined ? 
> 
> 
>
YC 
> 
> 
> Vincent Lejeune a écrit : 
> 
>> 
>> Hi, 
>> 
>> 
>> I don't know if it's a bug or if something is missing in my
code... 
>> The issue is : using the following code, I cannot
get scilab to 
>> display the mB matrix : 
>> 
>> #include "stack-c.h" 
>> #include
"api_scilab.h" 
>> #include "Scierror.h"

>> 
>> 
>> int oclexec(char* fname) {

>> SciErr sciErr; 
>> int *pB; int rowsB,colsB;
double* mB; int k; 
>> 
>>
mB=(double*)malloc(rowsB*colsB*sizeof(double)); 
>> 
>> 
>> for(k=0;k<rowsB*colsB;++k) { 
>>
mB[k]=1.0; } 
>> 
>> 
>> sciErr =
createMatrixOfDouble(pvApiCtx, Rhs + 1, rowsB, colsB,mB ); 
>>
if(sciErr.iErr) { 
>> printError(&sciErr, 0); return 0; }

>> 
>> 
>> LhsVar(1)=Rhs+1; 
>> 
>> 
>> return 0; } 
>> 
>> 
>> The gateway is compiling fine, but when I type
B=ocltest(A); , the B 
>> matrix is equal to A, whereas it is
expected to be a ones matrix. 
>> 
>> On the other
hand, the unary test double_writing_api.tst works. 
>> I'am
currently using the windows 1257195239 build (taken from the 
>> nightly build of scilab 5.2) 
>> 
>>
Regards, 
>> Vincent 
>> 
>> 
>

> 
> -- 
> ----------------------------- 
> Yann COLLETTE 
> Software Development Engineer 
>
----------------------------- 
> The Scilab Consortium 
>
Digiteo Foundation 
> Domaine de Voluceau 
> Rocquencourt
- B.P. 105 
> 78153 Le Chesnay France 
> Phone:
+33.1.39.63.57.82 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20091105/e2c7c8c7/attachment.htm>


More information about the dev mailing list