kcommonOrig.br 911 Bytes
Newer Older
Mark Friedrichs's avatar
Mark Friedrichs committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

/****************************************************************
* This file is part of the gpu acceleration library for gromacs.
* Author: V. Vishal
* Copyright (C) Pande Group, Stanford, 2006
*****************************************************************/

//Kernel to set the xyz components of a float4 stream
//Used for changing the coordinates without changing
//the charges in strPosQ
kernel void ksetxyz( float3 instr<>, float4 before<>, out float4 after<> ) {
	after.xyz = instr;
	after.w   = before.w;
}

//Inverse of above
kernel void kgetxyz( float4 instr<>, out float3 outstr<> ) {
	outstr = instr.xyz;
}


//Zeroes out a stream
kernel void kzerof3( out float3 outstr<> ) {
	outstr = float3( 0.0, 0.0, 0.0 );
}

//Zeros out a stream
kernel void kzerof4( out float4 outstr<> ) {
	outstr = float4( 0.0, 0.0, 0.0, 0.0 );
}

kernel void ksetf4( float4 val, out float4 outstr<> ) {
	outstr = val;
}