[opengtl-commits] [644] support different results directory for different architecture |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 644
Author: cyrille
Date: 2009-03-17 15:04:46 +0100 (Tue, 17 Mar 2009)
Log Message:
-----------
support different results directory for different architecture
Modified Paths:
--------------
trunk/OpenGTL/CMakeLists.txt
trunk/OpenGTL/OpenGTL/GTLCore/MemoryManager_p.cpp
trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt
trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt
trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt
trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp
Modified: trunk/OpenGTL/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/CMakeLists.txt 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/CMakeLists.txt 2009-03-17 14:04:46 UTC (rev 644)
@@ -35,6 +35,16 @@
include(Dart)
endif(OPENGTL_BUILD_TESTS)
+if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ # 32 bits
+ message(STATUS "OpenGTL detected that you use a 32 bit processor.")
+ set(OPENGTL_TESTS_DATA_RESULTS_DIR results32)
+else(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ # 32 bits
+ message(STATUS "OpenGTL detected that you use a 64 bit processor.")
+ set(OPENGTL_TESTS_DATA_RESULTS_DIR results64)
+ # TODO check that llvm was build with -fPIC
+endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OpenGTL ${CMAKE_CURRENT_BINARY_DIR}
)
Modified: trunk/OpenGTL/OpenGTL/GTLCore/MemoryManager_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/MemoryManager_p.cpp 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/OpenGTL/GTLCore/MemoryManager_p.cpp 2009-03-17 14:04:46 UTC (rev 644)
@@ -29,7 +29,7 @@
#define DEFAULT_SEGMENT_SIZE 100000
-// #define DEBUG_MEMORY_MANAGER
+#define DEBUG_MEMORY_MANAGER
#ifdef DEBUG_MEMORY_MANAGER
@@ -119,7 +119,7 @@
currentHeader = previousCurrentHeader;
MM_DEBUG( currentHeader->next );
} else {
- MM_DEBUG("Previous isn't free = " << uint(end - nextFree) );
+ MM_DEBUG("Previous (" << previousCurrentHeader << ") isn't free = " << uint(end - nextFree) );
previous = previousCurrentHeader;
previous->next = 0;
nextFree = reinterpret_cast<uint8_t*>(currentHeader);
@@ -145,17 +145,19 @@
void* MemoryManager::allocate(int size)
{
+ MM_DEBUG("Allocate: " << size);
if( Private::s_instance->uniqueSegment )
{
if( Private::s_instance->uniqueSegment->canContains(size) )
{
- return Private::s_instance->uniqueSegment->allocate(size);
+ void* ptr = Private::s_instance->uniqueSegment->allocate(size);
+ MM_DEBUG("ptr = " << ptr);
+ return ptr;
} else {
Private::s_instance->segments.push_back(Private::s_instance->uniqueSegment);
Private::s_instance->uniqueSegment = 0;
}
} else {
- MM_DEBUG("Allocate: " << size);
foreach(Segment* segment, Private::s_instance->segments)
{
if( segment->canContains(size) )
@@ -179,12 +181,12 @@
void MemoryManager::desallocate(void* ptr)
{
+ MM_DEBUG("Desallocate ptr = " << ptr);
if( Private::s_instance->uniqueSegment )
{
GTL_ASSERT(Private::s_instance->uniqueSegment->contains(ptr));
Private::s_instance->uniqueSegment->desallocate(ptr);
} else {
- MM_DEBUG("Desallocate ptr = " << ptr);
foreach(Segment* segment, Private::s_instance->segments)
{
if( segment->contains(ptr) )
Modified: trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/OpenShiva/tests/convolution/CMakeLists.txt 2009-03-17 14:04:46 UTC (rev 644)
@@ -6,6 +6,6 @@
)
FOREACH( TEST_FILE ${TESTS_FILES} )
- ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/fontromeu.png ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
+ ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/fontromeu.png ${OPENGTL_TESTS_DATA}/${OPENGTL_TESTS_DATA_RESULTS_DIR}/${TEST_FILE}.png)
ENDFOREACH( TEST_FILE )
Modified: trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/OpenShiva/tests/imagegenerators/CMakeLists.txt 2009-03-17 14:04:46 UTC (rev 644)
@@ -7,6 +7,6 @@
)
FOREACH( TEST_FILE ${TESTS_FILES} )
- ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
+ ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/${OPENGTL_TESTS_DATA_RESULTS_DIR}/${TEST_FILE}.png)
ENDFOREACH( TEST_FILE )
Modified: trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/OpenShiva/tests/raw/CMakeLists.txt 2009-03-17 14:04:46 UTC (rev 644)
@@ -9,7 +9,7 @@
)
FOREACH( TEST_FILE ${TESTS_FILES} )
- ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/dsc_0006-23-07-2008.nef ${OPENGTL_TESTS_DATA}/results/${TEST_FILE}.png)
+ ADD_TEST(${TEST_FILE} ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE} ${OPENGTL_TESTS_DATA}/sources/dsc_0006-23-07-2008.nef ${OPENGTL_TESTS_DATA}/${OPENGTL_TESTS_DATA_RESULTS_DIR}/${TEST_FILE}.png)
ENDFOREACH( TEST_FILE )
-ADD_TEST(PixelGroupingPass2.shiva ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass2.shiva ${OPENGTL_TESTS_DATA}/results/PixelGroupingPass1.shiva.png ${OPENGTL_TESTS_DATA}/results/PixelGroupingPass2.shiva.png)
+ADD_TEST(PixelGroupingPass2.shiva ${SHIVATESTER} -c ${CMAKE_CURRENT_SOURCE_DIR}/PixelGroupingPass2.shiva ${OPENGTL_TESTS_DATA}/${OPENGTL_TESTS_DATA_RESULTS_DIR}/PixelGroupingPass1.shiva.png ${OPENGTL_TESTS_DATA}/${OPENGTL_TESTS_DATA_RESULTS_DIR}/PixelGroupingPass2.shiva.png)
Modified: trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp 2009-03-17 10:29:16 UTC (rev 643)
+++ trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp 2009-03-17 14:04:46 UTC (rev 644)
@@ -188,6 +188,7 @@
return EXIT_FAILURE;
}
}
+ std::cout << "Start evaluation" << std::endl;
p.evaluatePixeles( region, images, &image );
int errorCount = image.compare( resultImage, region );
if( errorCount != 0 )