Commit 4b102962 authored by Leonardo Solis's avatar Leonardo Solis
Browse files

#31, removed alternative fixed-point for simplicity

parent 8bd524e8
...@@ -9,24 +9,13 @@ __kernel __attribute__ ((max_global_work_dim(0))) ...@@ -9,24 +9,13 @@ __kernel __attribute__ ((max_global_work_dim(0)))
__kernel __attribute__ ((reqd_work_group_size(1,1,1))) __kernel __attribute__ ((reqd_work_group_size(1,1,1)))
void Krnl_Conform( void Krnl_Conform(
__global const int* restrict KerConstStatic_rotlist_const, __global const int* restrict KerConstStatic_rotlist_const,
#if defined (FIXED_POINT_CONFORM)
__constant fixedpt3* restrict KerConstStatic_ref_coords_const,
__constant fixedpt3* restrict KerConstStatic_rotbonds_moving_vectors_const,
__constant fixedpt3* restrict KerConstStatic_rotbonds_unit_vectors_const,
#else
__constant float3* restrict KerConstStatic_ref_coords_const, __constant float3* restrict KerConstStatic_ref_coords_const,
__constant float3* restrict KerConstStatic_rotbonds_moving_vectors_const, __constant float3* restrict KerConstStatic_rotbonds_moving_vectors_const,
__constant float3* restrict KerConstStatic_rotbonds_unit_vectors_const, __constant float3* restrict KerConstStatic_rotbonds_unit_vectors_const,
#endif
unsigned int DockConst_rotbondlist_length, unsigned int DockConst_rotbondlist_length,
unsigned char DockConst_num_of_atoms, unsigned char DockConst_num_of_atoms,
unsigned char DockConst_num_of_genes, unsigned char DockConst_num_of_genes,
#if defined (FIXED_POINT_CONFORM)
__constant fixedpt4* restrict KerConstStatic_ref_orientation_quats_const,
#else
__constant float4* restrict KerConstStatic_ref_orientation_quats_const, __constant float4* restrict KerConstStatic_ref_orientation_quats_const,
#endif
unsigned short Host_RunId unsigned short Host_RunId
) )
{ {
...@@ -59,23 +48,7 @@ LOOP_WHILE_CONFORM_MAIN: ...@@ -59,23 +48,7 @@ LOOP_WHILE_CONFORM_MAIN:
while(active) { while(active) {
char mode; char mode;
#if defined (FIXED_POINT_CONFORM)
fixedpt phi;
fixedpt theta;
fixedpt genrotangle;
fixedpt3 genotype_xyz;
/*
fixedpt3 __attribute__ ((
memory,
numbanks(1),
bankwidth(16),
singlepump,
numreadports(3),
numwriteports(1)
)) loc_coords [MAX_NUM_OF_ATOMS];
*/
fixedpt3 loc_coords [MAX_NUM_OF_ATOMS];
#else
float phi; float phi;
float theta; float theta;
float genrotangle; float genrotangle;
...@@ -91,7 +64,6 @@ while(active) { ...@@ -91,7 +64,6 @@ while(active) {
)) loc_coords [MAX_NUM_OF_ATOMS]; )) loc_coords [MAX_NUM_OF_ATOMS];
*/ */
float3 loc_coords [MAX_NUM_OF_ATOMS]; float3 loc_coords [MAX_NUM_OF_ATOMS];
#endif
char actmode; char actmode;
read_pipe_block(chan_IGL2Conform_actmode, &actmode); read_pipe_block(chan_IGL2Conform_actmode, &actmode);
...@@ -103,11 +75,7 @@ while(active) { ...@@ -103,11 +75,7 @@ while(active) {
//printf("Conform: %u\n", mode); //printf("Conform: %u\n", mode);
#if defined (FIXED_POINT_CONFORM)
fixedpt genotype [ACTUAL_GENOTYPE_LENGTH];
#else
float genotype [ACTUAL_GENOTYPE_LENGTH]; float genotype [ACTUAL_GENOTYPE_LENGTH];
#endif
__attribute__((xcl_pipeline_loop)) __attribute__((xcl_pipeline_loop))
LOOP_FOR_CONFORM_READ_GENOTYPE: LOOP_FOR_CONFORM_READ_GENOTYPE:
...@@ -133,19 +101,6 @@ while(active) { ...@@ -133,19 +101,6 @@ while(active) {
//printf("Conform: %u %u\n", mode, i); //printf("Conform: %u %u\n", mode, i);
#if defined (FIXED_POINT_CONFORM)
// Convert float to fixedpt
fixedpt fx_tmp = fixedpt_fromfloat(fl_tmp);
switch (i) {
case 0: genotype_xyz.x = fx_tmp; break;
case 1: genotype_xyz.y = fx_tmp; break;
case 2: genotype_xyz.z = fx_tmp; break;
case 3: phi = fx_tmp; break;
case 4: theta = fx_tmp; break;
case 5: genrotangle = fx_tmp; break;
}
genotype [i] = fx_tmp;
#else
switch (i) { switch (i) {
case 0: genotype_xyz.x = fl_tmp; break; case 0: genotype_xyz.x = fl_tmp; break;
case 1: genotype_xyz.y = fl_tmp; break; case 1: genotype_xyz.y = fl_tmp; break;
...@@ -155,7 +110,6 @@ while(active) { ...@@ -155,7 +110,6 @@ while(active) {
case 5: genrotangle = fl_tmp; break; case 5: genrotangle = fl_tmp; break;
} }
genotype [i] = fl_tmp; genotype [i] = fl_tmp;
#endif
} }
#if defined (DEBUG_ACTIVE_KERNEL) #if defined (DEBUG_ACTIVE_KERNEL)
...@@ -173,11 +127,7 @@ while(active) { ...@@ -173,11 +127,7 @@ while(active) {
uint atom_id = rotation_list_element & RLIST_ATOMID_MASK; uint atom_id = rotation_list_element & RLIST_ATOMID_MASK;
// Capturing atom coordinates // Capturing atom coordinates
#if defined (FIXED_POINT_CONFORM)
fixedpt3 atom_to_rotate;
#else
float3 atom_to_rotate; float3 atom_to_rotate;
#endif
if ((rotation_list_element & RLIST_FIRSTROT_MASK) != 0) // If first rotation of this atom if ((rotation_list_element & RLIST_FIRSTROT_MASK) != 0) // If first rotation of this atom
{ {
...@@ -189,27 +139,12 @@ while(active) { ...@@ -189,27 +139,12 @@ while(active) {
} }
// Capturing rotation vectors and angle // Capturing rotation vectors and angle
#if defined (FIXED_POINT_CONFORM)
fixedpt3 rotation_unitvec;
fixedpt3 rotation_movingvec;
fixedpt rotation_angle;
#else
float3 rotation_unitvec; float3 rotation_unitvec;
float3 rotation_movingvec; float3 rotation_movingvec;
float rotation_angle; float rotation_angle;
#endif
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation
{ {
#if defined (FIXED_POINT_CONFORM)
fixedpt sin_theta, cos_theta;
fixedpt3 genrot_unitvec;
sin_theta = fixedpt_sin(theta);
cos_theta = fixedpt_cos(theta);
genrot_unitvec.x = fixedpt_mul(sin_theta, fixedpt_cos(phi));
genrot_unitvec.y = fixedpt_mul(sin_theta, fixedpt_sin(phi));
genrot_unitvec.z = cos_theta;
#else
float sin_theta, cos_theta; float sin_theta, cos_theta;
float3 genrot_unitvec; float3 genrot_unitvec;
sin_theta = native_sin(theta); sin_theta = native_sin(theta);
...@@ -217,12 +152,9 @@ while(active) { ...@@ -217,12 +152,9 @@ while(active) {
genrot_unitvec.x = sin_theta*native_cos(phi); genrot_unitvec.x = sin_theta*native_cos(phi);
genrot_unitvec.y = sin_theta*native_sin(phi); genrot_unitvec.y = sin_theta*native_sin(phi);
genrot_unitvec.z = cos_theta; genrot_unitvec.z = cos_theta;
#endif
rotation_unitvec = genrot_unitvec; rotation_unitvec = genrot_unitvec;
rotation_angle = genrotangle; rotation_angle = genrotangle;
rotation_movingvec = genotype_xyz; rotation_movingvec = genotype_xyz;
} }
else // If rotating around rotatable bond else // If rotating around rotatable bond
...@@ -237,40 +169,15 @@ while(active) { ...@@ -237,40 +169,15 @@ while(active) {
// In addition performing the first movement // In addition performing the first movement
// which is needed only if rotating around rotatable bond // which is needed only if rotating around rotatable bond
#if defined (FIXED_POINT_CONFORM)
atom_to_rotate.x = fixedpt_sub(atom_to_rotate.x, rotation_movingvec.x);
atom_to_rotate.y = fixedpt_sub(atom_to_rotate.y, rotation_movingvec.y);
atom_to_rotate.z = fixedpt_sub(atom_to_rotate.z, rotation_movingvec.z);
#else
atom_to_rotate -= rotation_movingvec; atom_to_rotate -= rotation_movingvec;
#endif
} }
// Performing rotation // Performing rotation
#if defined (FIXED_POINT_CONFORM)
fixedpt quatrot_left_x, quatrot_left_y, quatrot_left_z, quatrot_left_q;
fixedpt quatrot_temp_x, quatrot_temp_y, quatrot_temp_z, quatrot_temp_q;
#else
float4 quatrot_left; float4 quatrot_left;
float4 quatrot_temp; float4 quatrot_temp;
#endif
#if defined (FIXED_POINT_CONFORM)
rotation_angle = rotation_angle >> 1;
#else
rotation_angle = rotation_angle*0.5f; rotation_angle = rotation_angle*0.5f;
#endif
#if defined (FIXED_POINT_CONFORM)
fixedpt sin_angle, cos_angle;
sin_angle = fixedpt_sin(rotation_angle);
cos_angle = fixedpt_cos(rotation_angle);
quatrot_left_x = fixedpt_mul(sin_angle, rotation_unitvec.x);
quatrot_left_y = fixedpt_mul(sin_angle, rotation_unitvec.y);
quatrot_left_z = fixedpt_mul(sin_angle, rotation_unitvec.z);
quatrot_left_q = cos_angle;
#else
float sin_angle, cos_angle; float sin_angle, cos_angle;
sin_angle = native_sin(rotation_angle); sin_angle = native_sin(rotation_angle);
cos_angle = native_cos(rotation_angle); cos_angle = native_cos(rotation_angle);
...@@ -278,59 +185,22 @@ while(active) { ...@@ -278,59 +185,22 @@ while(active) {
quatrot_left.y = sin_angle*rotation_unitvec.y; quatrot_left.y = sin_angle*rotation_unitvec.y;
quatrot_left.z = sin_angle*rotation_unitvec.z; quatrot_left.z = sin_angle*rotation_unitvec.z;
quatrot_left.w = cos_angle; quatrot_left.w = cos_angle;
#endif
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation, if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation,
// two rotations should be performed // two rotations should be performed
// (multiplying the quaternions) // (multiplying the quaternions)
{ {
#if defined (FIXED_POINT_CONFORM)
const fixedpt4 ref_orientation_quats_const = KerConstStatic_ref_orientation_quats_const[Host_RunId];
const fixedpt ref_orientation_quats_const_0 = ref_orientation_quats_const.x;
const fixedpt ref_orientation_quats_const_1 = ref_orientation_quats_const.y;
const fixedpt ref_orientation_quats_const_2 = ref_orientation_quats_const.z;
const fixedpt ref_orientation_quats_const_3 = ref_orientation_quats_const.w;
#else
const float4 ref_orientation_quats_const = KerConstStatic_ref_orientation_quats_const[Host_RunId]; const float4 ref_orientation_quats_const = KerConstStatic_ref_orientation_quats_const[Host_RunId];
const float ref_orientation_quats_const_0 = ref_orientation_quats_const.x; const float ref_orientation_quats_const_0 = ref_orientation_quats_const.x;
const float ref_orientation_quats_const_1 = ref_orientation_quats_const.y; const float ref_orientation_quats_const_1 = ref_orientation_quats_const.y;
const float ref_orientation_quats_const_2 = ref_orientation_quats_const.z; const float ref_orientation_quats_const_2 = ref_orientation_quats_const.z;
const float ref_orientation_quats_const_3 = ref_orientation_quats_const.w; const float ref_orientation_quats_const_3 = ref_orientation_quats_const.w;
#endif
// Calculating quatrot_left*ref_orientation_quats_const, // Calculating quatrot_left*ref_orientation_quats_const,
// which means that reference orientation rotation is the first // which means that reference orientation rotation is the first
#if defined (FIXED_POINT_CONFORM)
quatrot_temp_q = quatrot_left_q;
quatrot_temp_x = quatrot_left_x;
quatrot_temp_y = quatrot_left_y;
quatrot_temp_z = quatrot_left_z;
#else
quatrot_temp = quatrot_left; quatrot_temp = quatrot_left;
#endif
// Taking the first element of ref_orientation_quats_const member // Taking the first element of ref_orientation_quats_const member
#if defined (FIXED_POINT_CONFORM)
quatrot_left_q = fixedpt_mul(quatrot_temp_q, ref_orientation_quats_const_0)
- fixedpt_mul(quatrot_temp_x, ref_orientation_quats_const_1)
- fixedpt_mul(quatrot_temp_y, ref_orientation_quats_const_2)
- fixedpt_mul(quatrot_temp_z, ref_orientation_quats_const_3);
quatrot_left_x = fixedpt_mul(quatrot_temp_q, ref_orientation_quats_const_1)
+ fixedpt_mul(quatrot_temp_x, ref_orientation_quats_const_0)
+ fixedpt_mul(quatrot_temp_y, ref_orientation_quats_const_3)
- fixedpt_mul(quatrot_temp_z, ref_orientation_quats_const_2);
quatrot_left_y = fixedpt_mul(quatrot_temp_q, ref_orientation_quats_const_2)
- fixedpt_mul(quatrot_temp_x, ref_orientation_quats_const_3)
+ fixedpt_mul(quatrot_temp_y, ref_orientation_quats_const_0)
+ fixedpt_mul(quatrot_temp_z, ref_orientation_quats_const_1);
quatrot_left_z = fixedpt_mul(quatrot_temp_q, ref_orientation_quats_const_3)
+ fixedpt_mul(quatrot_temp_x, ref_orientation_quats_const_2)
- fixedpt_mul(quatrot_temp_y, ref_orientation_quats_const_1)
+ fixedpt_mul(quatrot_temp_z, ref_orientation_quats_const_0);
#else
float4 ref4x = { ref_orientation_quats_const_0, ref_orientation_quats_const_3, - ref_orientation_quats_const_2, ref_orientation_quats_const_1}; float4 ref4x = { ref_orientation_quats_const_0, ref_orientation_quats_const_3, - ref_orientation_quats_const_2, ref_orientation_quats_const_1};
float4 ref4y = { - ref_orientation_quats_const_3, ref_orientation_quats_const_0, ref_orientation_quats_const_1, ref_orientation_quats_const_2}; float4 ref4y = { - ref_orientation_quats_const_3, ref_orientation_quats_const_0, ref_orientation_quats_const_1, ref_orientation_quats_const_2};
float4 ref4z = { ref_orientation_quats_const_2, - ref_orientation_quats_const_1, ref_orientation_quats_const_0, ref_orientation_quats_const_3}; float4 ref4z = { ref_orientation_quats_const_2, - ref_orientation_quats_const_1, ref_orientation_quats_const_0, ref_orientation_quats_const_3};
...@@ -340,41 +210,8 @@ while(active) { ...@@ -340,41 +210,8 @@ while(active) {
quatrot_left.y = dot(quatrot_temp, ref4y); quatrot_left.y = dot(quatrot_temp, ref4y);
quatrot_left.z = dot(quatrot_temp, ref4z); quatrot_left.z = dot(quatrot_temp, ref4z);
quatrot_left.w = dot(quatrot_temp, ref4w); quatrot_left.w = dot(quatrot_temp, ref4w);
#endif
} }
#if defined (FIXED_POINT_CONFORM)
quatrot_temp_q = - fixedpt_mul(quatrot_left_x, atom_to_rotate.x)
- fixedpt_mul(quatrot_left_y, atom_to_rotate.y)
- fixedpt_mul(quatrot_left_z, atom_to_rotate.z);
quatrot_temp_x = fixedpt_mul(quatrot_left_q, atom_to_rotate.x)
+ fixedpt_mul(quatrot_left_y, atom_to_rotate.z)
- fixedpt_mul(quatrot_left_z, atom_to_rotate.y);
quatrot_temp_y = fixedpt_mul(quatrot_left_q, atom_to_rotate.y)
- fixedpt_mul(quatrot_left_x, atom_to_rotate.z)
+ fixedpt_mul(quatrot_left_z, atom_to_rotate.x);
quatrot_temp_z = fixedpt_mul(quatrot_left_q, atom_to_rotate.z)
+ fixedpt_mul(quatrot_left_x, atom_to_rotate.y)
- fixedpt_mul(quatrot_left_y, atom_to_rotate.x);
atom_to_rotate.x = - fixedpt_mul(quatrot_temp_q, quatrot_left_x)
+ fixedpt_mul(quatrot_temp_x, quatrot_left_q)
- fixedpt_mul(quatrot_temp_y, quatrot_left_z)
+ fixedpt_mul(quatrot_temp_z, quatrot_left_y);
atom_to_rotate.y = - fixedpt_mul(quatrot_temp_q, quatrot_left_y)
+ fixedpt_mul(quatrot_temp_x, quatrot_left_z)
+ fixedpt_mul(quatrot_temp_y, quatrot_left_q)
- fixedpt_mul(quatrot_temp_z, quatrot_left_x);
atom_to_rotate.z = - fixedpt_mul(quatrot_temp_q, quatrot_left_z)
- fixedpt_mul(quatrot_temp_x, quatrot_left_y)
+ fixedpt_mul(quatrot_temp_y, quatrot_left_x)
+ fixedpt_mul(quatrot_temp_z, quatrot_left_q);
#else
float3 left3x = { quatrot_left.w, - quatrot_left.z, quatrot_left.y}; float3 left3x = { quatrot_left.w, - quatrot_left.z, quatrot_left.y};
float3 left3y = { quatrot_left.z, quatrot_left.w, - quatrot_left.x}; float3 left3y = { quatrot_left.z, quatrot_left.w, - quatrot_left.x};
float3 left3z = {- quatrot_left.y, quatrot_left.x, quatrot_left.w}; float3 left3z = {- quatrot_left.y, quatrot_left.x, quatrot_left.w};
...@@ -392,7 +229,6 @@ while(active) { ...@@ -392,7 +229,6 @@ while(active) {
atom_to_rotate.x = dot(quatrot_temp, left4x); atom_to_rotate.x = dot(quatrot_temp, left4x);
atom_to_rotate.y = dot(quatrot_temp, left4y); atom_to_rotate.y = dot(quatrot_temp, left4y);
atom_to_rotate.z = dot(quatrot_temp, left4z); atom_to_rotate.z = dot(quatrot_temp, left4z);
#endif
// Performing final movement and storing values // Performing final movement and storing values
loc_coords[atom_id] = atom_to_rotate + rotation_movingvec; loc_coords[atom_id] = atom_to_rotate + rotation_movingvec;
...@@ -410,49 +246,6 @@ while(active) { ...@@ -410,49 +246,6 @@ while(active) {
// -------------------------------------------------------------- // --------------------------------------------------------------
// Send ligand atomic coordinates to channel // Send ligand atomic coordinates to channel
// -------------------------------------------------------------- // --------------------------------------------------------------
/*
write_channel_altera(chan_Conf2Intere_active, active);
write_channel_altera(chan_Conf2Intrae_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_Conf2Intere_mode, mode);
write_channel_altera(chan_Conf2Intrae_mode, mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
//float3 position_xyz;
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt++) {
write_channel_altera(chan_Conf2Intere_xyz, loc_coords[pipe_cnt]);
write_channel_altera(chan_Conf2Intrae_xyz, loc_coords[pipe_cnt]);
}*/
/*
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt++) {
if (pipe_cnt == 0) {
char active_tmp = active;
char mode_tmp = mode;
char2 actmode = {active_tmp, mode_tmp};
write_channel_altera(chan_Conf2Intere_actmode, actmode);
write_channel_altera(chan_Conf2Intrae_actmode, actmode);
}
mem_fence(CLK_CHANNEL_MEM_FENCE);
#if defined (FIXED_POINT_CONFORM)
// convert fixedpt3 to float3
float tmp_x = fixedpt_tofloat(loc_coords[pipe_cnt].x);
float tmp_y = fixedpt_tofloat(loc_coords[pipe_cnt].y);
float tmp_z = fixedpt_tofloat(loc_coords[pipe_cnt].z);
float3 tmp = {tmp_x, tmp_y, tmp_z};
#else
float3 tmp = loc_coords[pipe_cnt];
#endif
write_channel_altera(chan_Conf2Intere_xyz, tmp);
write_channel_altera(chan_Conf2Intrae_xyz, tmp);
}
*/
__attribute__((xcl_pipeline_loop)) __attribute__((xcl_pipeline_loop))
LOOP_FOR_CONFORM_WRITE_XYZ: LOOP_FOR_CONFORM_WRITE_XYZ:
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt+=2) { for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt+=2) {
...@@ -464,11 +257,7 @@ while(active) { ...@@ -464,11 +257,7 @@ while(active) {
mem_fence(CLK_CHANNEL_MEM_FENCE); mem_fence(CLK_CHANNEL_MEM_FENCE);
*/ */
#if defined (FIXED_POINT_CONFORM)
fixedpt3 tmp_coords[2];
#else
float3 tmp_coords[2]; float3 tmp_coords[2];
#endif
__attribute__((opencl_unroll_hint)) __attribute__((opencl_unroll_hint))
LOOP_CONFORM_OUT: LOOP_CONFORM_OUT:
...@@ -478,20 +267,8 @@ while(active) { ...@@ -478,20 +267,8 @@ while(active) {
float8 tmp; float8 tmp;
#if defined (FIXED_POINT_CONFORM)
// Convert fixedpt3 to float3
float tmp_x1 = fixedpt_tofloat(tmp_coords[0].x);
float tmp_y1 = fixedpt_tofloat(tmp_coords[0].y);
float tmp_z1 = fixedpt_tofloat(tmp_coords[0].z);
float tmp_x2 = fixedpt_tofloat(tmp_coords[1].x);
float tmp_y2 = fixedpt_tofloat(tmp_coords[1].y);
float tmp_z2 = fixedpt_tofloat(tmp_coords[1].z);
tmp.s0 = tmp_x1; tmp.s1 = tmp_y1; tmp.s2 = tmp_z1; //tmp.s3
tmp.s4 = tmp_x2; tmp.s5 = tmp_y2; tmp.s6 = tmp_z2; //tmp.s7
#else
tmp.s0 = tmp_coords[0].x; tmp.s1 = tmp_coords[0].y; tmp.s2 = tmp_coords[0].z; //tmp.s3 tmp.s0 = tmp_coords[0].x; tmp.s1 = tmp_coords[0].y; tmp.s2 = tmp_coords[0].z; //tmp.s3
tmp.s4 = tmp_coords[1].x; tmp.s5 = tmp_coords[1].y; tmp.s6 = tmp_coords[1].z; //tmp.s7 tmp.s4 = tmp_coords[1].x; tmp.s5 = tmp_coords[1].y; tmp.s6 = tmp_coords[1].z; //tmp.s7
#endif
write_pipe_block(chan_Conf2Intere_xyz, &tmp); write_pipe_block(chan_Conf2Intere_xyz, &tmp);
write_pipe_block(chan_Conf2Intrae_xyz, &tmp); write_pipe_block(chan_Conf2Intrae_xyz, &tmp);
......
...@@ -183,26 +183,6 @@ pipe float chan_IGL2Conform_genotype __attribute__((xcl_reqd_pipe_depth(P ...@@ -183,26 +183,6 @@ pipe float chan_IGL2Conform_genotype __attribute__((xcl_reqd_pipe_depth(P
// Resized to valid SDAccel depths: 16, 32, ... // Resized to valid SDAccel depths: 16, 32, ...
pipe int chan_IGLArbiter_Off __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16))); pipe int chan_IGLArbiter_Off __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
#if defined (FIXED_POINT_CONFORM) || \
defined (FIXED_POINT_LS1) || \
defined (FIXED_POINT_LS2) || \
defined (FIXED_POINT_LS3) || \
defined (FIXED_POINT_LS4) || \
defined (FIXED_POINT_LS5) || \
defined (FIXED_POINT_LS6) || \
defined (FIXED_POINT_LS7) || \
defined (FIXED_POINT_LS8) || \
defined (FIXED_POINT_LS9)
#include "../defines_fixedpt.h"
typedef int3 fixedpt3;
typedef int4 fixedpt4;
#endif
#if defined (FIXED_POINT_INTERE) || defined (FIXED_POINT_INTRAE)
#include "../defines_fixedpt_64.h"
#endif
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Map the argument into the interval 0 - 180, or 0 - 360 // Map the argument into the interval 0 - 180, or 0 - 360
// by adding/subtracting n*ang_max to/from it. // by adding/subtracting n*ang_max to/from it.
...@@ -233,43 +213,6 @@ float map_angle_360(float angle) ...@@ -233,43 +213,6 @@ float map_angle_360(float angle)
return x; return x;
} }
#if defined (FIXED_POINT_LS1) || \
defined (FIXED_POINT_LS2) || \
defined (FIXED_POINT_LS3) || \
defined (FIXED_POINT_LS4) || \
defined (FIXED_POINT_LS5) || \
defined (FIXED_POINT_LS6) || \
defined (FIXED_POINT_LS7) || \
defined (FIXED_POINT_LS8) || \
defined (FIXED_POINT_LS9)
#define FIXEDPT_180 0xB40000
#define FIXEDPT_360 0x1680000
fixedpt fixedpt_map_angle_180(fixedpt angle)
{
fixedpt x = angle;
//while (x < 0.0f)
if (x < 0)
{ x += FIXEDPT_180; }
//while (x > 180.0f)
if (x > FIXEDPT_180)
{ x -= FIXEDPT_180; }
return x;
}
fixedpt fixedpt_map_angle_360(fixedpt angle)
{
fixedpt x = angle;
//while (x < 0.0f)
if (x < 0)
{ x += FIXEDPT_360; }
//while (x > 360.0f)
if (x > FIXEDPT_360)
{ x -= FIXEDPT_360;}
return x;
}
#endif
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Lamarckian Genetic-Algorithm (GA): GA + LS (Local Search) // Lamarckian Genetic-Algorithm (GA): GA + LS (Local Search)
// Originally from: searchoptimum.c // Originally from: searchoptimum.c
......
...@@ -12,39 +12,17 @@ __kernel __attribute__ ((max_global_work_dim(0))) ...@@ -12,39 +12,17 @@ __kernel __attribute__ ((max_global_work_dim(0)))
__kernel __attribute__ ((reqd_work_group_size(1,1,1))) __kernel __attribute__ ((reqd_work_group_size(1,1,1)))
void Krnl_InterE( void Krnl_InterE(
__global const float* restrict GlobFgrids, __global const float* restrict GlobFgrids,
#if defined (FIXED_POINT_INTERE)
__constant fixedpt64* restrict KerConstStatic_atom_charges_const,
#else
__constant float* restrict KerConstStatic_atom_charges_const, __constant float* restrict KerConstStatic_atom_charges_const,
#endif
__constant char* restrict KerConstStatic_atom_types_const, __constant char* restrict KerConstStatic_atom_types_const,
unsigned char DockConst_g1, unsigned char DockConst_g1,
unsigned int DockConst_g2, unsigned int DockConst_g2,
unsigned int DockConst_g3, unsigned int DockConst_g3,
unsigned char DockConst_num_of_atoms, unsigned char DockConst_num_of_atoms,
#if defined (FIXED_POINT_INTERE)
unsigned char DockConst_gridsize_x_minus1,
unsigned char DockConst_gridsize_y_minus1,
unsigned char DockConst_gridsize_z_minus1,
#else