Чистка мелочей в примерах
This commit is contained in:
parent
87ef23828c
commit
a8f8bc443c
|
|
@ -14,14 +14,14 @@ __kernel void MatrMltMatr(__global double* A, __global double* B, __global doubl
|
|||
C[cX + cY*W] = sum;
|
||||
}
|
||||
|
||||
__kernel void MatrMltVec(__global double* C, __global double* V, __global double* V2, __global int* gW)
|
||||
__kernel void MatrMltVec(__global double* C, __global double* V1, __global double* V2, __global int* gW)
|
||||
{
|
||||
int i = get_global_id(0);
|
||||
int W = *gW;
|
||||
|
||||
double sum = 0.0;
|
||||
for (int j=0; j<W; j++)
|
||||
sum += C[j + i*W] * V[j];
|
||||
sum += C[j + i*W] * V1[j];
|
||||
|
||||
V2[i] = sum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@ __kernel void MatrMltMatr(__global double* A, __global double* B, __global doubl
|
|||
C[cX + cY*W] = sum;
|
||||
}
|
||||
|
||||
__kernel void MatrMltVec(__global double* C, __global double* V, __global double* V2, __global int* gW)
|
||||
__kernel void MatrMltVec(__global double* C, __global double* V1, __global double* V2, __global int* gW)
|
||||
{
|
||||
int i = get_global_id(0);
|
||||
int W = *gW;
|
||||
|
||||
double sum = 0.0;
|
||||
for (int j=0; j<W; j++)
|
||||
sum += C[j + i*W] * V[j];
|
||||
sum += C[j + i*W] * V1[j];
|
||||
|
||||
V2[i] = sum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ begin
|
|||
|
||||
var Calc_C_Q :=
|
||||
code['MatrMltMatr'].NewQueue.Exec(MatrW, MatrW,
|
||||
A.NewQueue.WriteData(A_Mart),
|
||||
B.NewQueue.WriteData(B_Mart),
|
||||
A.NewQueue.WriteData(A_Mart) as CommandQueue<KernelArg>,
|
||||
B.NewQueue.WriteData(B_Mart) as CommandQueue<KernelArg>,
|
||||
C,
|
||||
KernelArg.ValueQueue(MatrW)
|
||||
);
|
||||
KernelArg.ValueQueue(MatrW) as CommandQueue<KernelArg>
|
||||
) as CommandQueue<Kernel>;
|
||||
|
||||
var Otp_C_Q :=
|
||||
HFQ(
|
||||
|
|
@ -66,15 +66,15 @@ begin
|
|||
writeln;
|
||||
end;
|
||||
end
|
||||
);
|
||||
) as CommandQueue<array[,] of real>;
|
||||
|
||||
var Calc_V2_Q :=
|
||||
code['MatrMltVec'].NewQueue.Exec(MatrW,
|
||||
C,
|
||||
V1.NewQueue.WriteData(V1_Arr),
|
||||
V1.NewQueue.WriteData(V1_Arr) as CommandQueue<KernelArg>,
|
||||
V2,
|
||||
KernelArg.ValueQueue(MatrW)
|
||||
);
|
||||
KernelArg.ValueQueue(MatrW) as CommandQueue<KernelArg>
|
||||
) as CommandQueue<Kernel>;
|
||||
|
||||
var Otp_V2_Q :=
|
||||
HFQ(
|
||||
|
|
@ -88,7 +88,7 @@ begin
|
|||
writeln;
|
||||
end;
|
||||
end
|
||||
);
|
||||
) as CommandQueue<array of real>;
|
||||
|
||||
// Выполнение всего и сразу асинхронный вывод
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ begin
|
|||
|
||||
A.NewQueue.WriteData(
|
||||
ArrFill(10,1)
|
||||
)
|
||||
) as CommandQueue<KernelArg>
|
||||
|
||||
);
|
||||
) as CommandQueue<Kernel>;
|
||||
|
||||
// Выполнение
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue