git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2104 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
379c333733
commit
fad9840aed
1 changed files with 43 additions and 45 deletions
|
|
@ -74,13 +74,13 @@ public:
|
|||
moCudaKswapEval(unsigned int _neighborhoodSize, IncrementEval & _incrEval) :
|
||||
moCudaEval<Neighbor> (_neighborhoodSize), incrEval(_incrEval) {
|
||||
mutex = false;
|
||||
mutex_kswap=false;
|
||||
mutex_kswap = false;
|
||||
}
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~moCudaKswapEval() {
|
||||
if(mutex_kswap){
|
||||
if (mutex_kswap) {
|
||||
cudaFree(&device_setSolution);
|
||||
cudaFree(&device_tmp);
|
||||
delete[] vect;
|
||||
|
|
@ -131,7 +131,6 @@ public:
|
|||
//Case Kswap
|
||||
else if (_Kswap > 1) {
|
||||
if (!mutex_kswap) {
|
||||
|
||||
vect = new T[neighborhoodSize * _size];
|
||||
//Allocate the space for set of solution in the device global memory
|
||||
cudaMalloc((void**) &device_setSolution.vect, neighborhoodSize
|
||||
|
|
@ -140,7 +139,6 @@ public:
|
|||
cudaMalloc((void**) &device_tmp.vect, neighborhoodSize
|
||||
* sizeof(T));
|
||||
mutex_kswap = true;
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < neighborhoodSize; i++) {
|
||||
|
|
@ -169,14 +167,14 @@ public:
|
|||
* @param _Kflip the number of flip to do
|
||||
*/
|
||||
|
||||
void neighborhoodKflipEval(EOT & _sol, unsigned * _mapping, unsigned _Kflip) {
|
||||
void neighborhoodKflipEval(EOT & _sol, unsigned * _mapping,
|
||||
unsigned _Kflip) {
|
||||
|
||||
// the solution size
|
||||
unsigned _size = _sol.size();
|
||||
|
||||
// Get Current solution fitness
|
||||
Fitness fitness = _sol.fitness();
|
||||
|
||||
if (!mutex) {
|
||||
//Allocate the space for solution in the device global memory
|
||||
cudaMalloc((void**) &device_solution.vect, _size * sizeof(T));
|
||||
|
|
@ -195,7 +193,7 @@ public:
|
|||
* sizeof(Fitness), cudaMemcpyDeviceToHost);
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
IncrementEval & incrEval;
|
||||
//NeighborhoodSize copy of solution
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue