|
From: Jaakan S. <jaa...@gm...> - 2008-12-23 19:00:40
|
I did read through the thread "Re: [MUMmerGPU-devel] MUMmer GPU build error"
that did help me. I'm also at the point were CPU using the -C switch
works and Segmentation faults without it.
I have access to NV GPU+RHEL5 x64 server, if you need me to send you
the gdb/debuged output
I might have done a few more changes to get this to run on RHEL5 x64,
I can tar.gz my current source for this with my changes if anyone
needs to look at all of the changes.
I hope I can help.
--Jaakan
Here are some changes I made to fix the following warnings on 64bit
linux and don't forget to add " #include <stdint.h> "
"warning: conversion from pointer to smaller integer"
this " * timer = (unsigned int) ptr " should be " * timer = (uintptr_t) ptr"
"warning: cast to pointer from integer of different size"
basicly "unsigned int ptr" needs to be "uintptr_t ptr"
mummergpu.cu
...
#include <stdint.h>
// includes, kernels
#include "common.cu"
#include "mummergpu.h"
#include "mummergpu_kernel.cu"
#define ulong4 uint32_t
....
// Timer management
struct Timer_t
{
struct timeval start_m;
struct timeval end_m;
};
void createTimer(unsigned int * timer)
{
unsigned int * ptr = (unsigned int *) malloc(sizeof(struct Timer_t));
memset(ptr, 0, sizeof(struct Timer_t));
// * timer = (unsigned int) ptr;
* timer = (uintptr_t) ptr;
}
// void startTimer(unsigned int ptr)
void startTimer(uintptr_t ptr)
{
gettimeofday(&(((struct Timer_t *)ptr)->start_m), NULL);
}
// void stopTimer(unsigned int ptr)
void stopTimer(uintptr_t ptr)
{
gettimeofday(&(((struct Timer_t *)ptr)->end_m), NULL);
}
//float getTimerValue(unsigned int ptr)
float getTimerValue(uintptr_t ptr)
{
Timer_t * timer = (Timer_t*) ptr;
if (timer == NULL)
{
fprintf(stderr, "Uninitialized timer!!!\n");
return 0.0;
}
if (timer->end_m.tv_sec == 0) { stopTimer(ptr); }
return (float) (1000.0 * (timer->end_m.tv_sec - timer->start_m.tv_sec)
+ (0.001 * (timer->end_m.tv_usec - timer->start_m.tv_usec)));
}
//void deleteTimer(unsigned int ptr)
void deleteTimer(uintptr_t ptr)
{
free((Timer_t *)ptr);
}
....
I changed " ulong4 data " to " unsigned int data " in the following.
common.cu
....
#ifndef COMMON_CU__
#define COMMON_CU__ 1
// Children are labeled as ACGT$
const int basecount = 5;
// Note: max pixel size is 16 bytes
const unsigned char DNA_A = 'A';
const unsigned char DNA_C = 'B';
const unsigned char DNA_G = 'C';
const unsigned char DNA_T = 'D';
const unsigned char DNA_S = 'E';
// 4 bytes
struct TextureAddress
{
union
{
unsigned int data;
struct
{
unsigned short x;
unsigned short y;
};
};
};
// Store the start, end coordinate of node, and $link in 1 pixel
struct PixelOfNode
{
union
{
// ulong4 data;
unsigned int data;
struct
{
int start;
int end;
TextureAddress childD;
TextureAddress suffix;
};
};
};
// Store the ACGT links in 1 pixel
struct PixelOfChildren
{
union
{
// ulong4 data;
unsigned int data;
TextureAddress children[4];
};
};
#define FORWARD 0x0000
#define REVERSE 0x8000
#define FRMASK 0x8000
#define FRUMASK 0x7FFF
#endif
|