- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, im Jack.
Im trying to convert to the MKL in my some source.
The problem is the difference between the output datas.
The original code is :
for(ix=0; ix for(iz=0; iz t[ix][iz] = a1*t1[ix][iz] + a2*t2[ix][iz];
Like this. and converting to MKL(BLAS) is :
for(ix=0; ix {
cblas_sscal(nz, a1, t1[ix], 1);
cblas_scopy(nz, t1[ix], 1, t[ix], 1);
cblas_saxpy(nz, a2, t2[ix], 1, t[ix], 1);
}
t, t1, t2 Array are varible of float type.The Output data is a little bit wrong.
But I need accuracy data becauseit isrelated withmy work.
I don't know where is wrong. Did I miss something to do ?
Please help me.
Im trying to convert to the MKL in my some source.
The problem is the difference between the output datas.
The original code is :
for(ix=0; ix
Like this. and converting to MKL(BLAS) is :
for(ix=0; ix
cblas_sscal(nz, a1, t1[ix], 1);
cblas_scopy(nz, t1[ix], 1, t[ix], 1);
cblas_saxpy(nz, a2, t2[ix], 1, t[ix], 1);
}
t, t1, t2 Array are varible of float type.The Output data is a little bit wrong.
But I need accuracy data becauseit isrelated withmy work.
I don't know where is wrong. Did I miss something to do ?
Please help me.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you require the effect of (double)a1*t1[ix][iz] + (double)a2*t[ix][iz] (K&R style evaluation, still default 2 decades later, for many C compilers), you are better off with the C code. If you want good performance, you should get the same numerical result, with much better performance than cblas, by compiling your C code with a vectorizing compiler, without the implicit promotion to double.
I find your style misleading, particularly without the data definitions.
I find your style misleading, particularly without the data definitions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
If you require the effect of (double)a1*t1[ix][iz] + (double)a2*t[ix][iz] (K&R style evaluation, still default 2 decades later, for many C compilers), you are better off with the C code. If you want good performance, you should get the same numerical result, with much better performance than cblas, by compiling your C code with a vectorizing compiler, without the implicit promotion to double.
I find your style misleading, particularly without the data definitions.
I find your style misleading, particularly without the data definitions.
Thank you abt the advise.
Your saying is all correct. I want better performance than before.
But vectorizing or parallelizing things are already being tried by another team member.
My target is only converting to MKL. that's why i've been trying to do with MKL.
Now i wonder if cblas_saxpy function is workedby 2 dimentional array or not.
like :
t[ix][iz] += (float)a1*t1[ix][iz];
=> cblas_saxpy(nz, a1, t1[ix] ,1 , t[ix] , 1);
if i convert like this, i can't get same numerical results. is it impassible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - galbimen
Hi, im Jack.
Im trying to convert to the MKL in my some source.
The problem is the difference between the output datas.
The original code is :
for(ix=0; ix for(iz=0; iz t[ix][iz] = a1*t1[ix][iz] + a2*t2[ix][iz];
Like this. and converting to MKL(BLAS) is :
for(ix=0; ix {
cblas_sscal(nz, a1, t1[ix], 1);
cblas_scopy(nz, t1[ix], 1, t[ix], 1);
cblas_saxpy(nz, a2, t2[ix], 1, t[ix], 1);
}
t, t1, t2 Array are varible of float type.The Output data is a little bit wrong.
But I need accuracy data becauseit isrelated withmy work.
I don't know where is wrong. Did I miss something to do ?
Please help me.
Im trying to convert to the MKL in my some source.
The problem is the difference between the output datas.
The original code is :
for(ix=0; ix
Like this. and converting to MKL(BLAS) is :
for(ix=0; ix
cblas_sscal(nz, a1, t1[ix], 1);
cblas_scopy(nz, t1[ix], 1, t[ix], 1);
cblas_saxpy(nz, a2, t2[ix], 1, t[ix], 1);
}
t, t1, t2 Array are varible of float type.The Output data is a little bit wrong.
But I need accuracy data becauseit isrelated withmy work.
I don't know where is wrong. Did I miss something to do ?
Please help me.
Galbimen,
The Output data is a little bit wrong.
What is the size of this difference?
What is the input data?
Can you get us the test case for the investigating the problem?
--Gennady
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page