bench_libstl: fix build issues
This commit is contained in:
parent
5661cb656b
commit
2b94d317bc
@ -7,7 +7,7 @@ CONFIG -= build_all
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = bench_libstl$$TARGET_SUFFIX
|
TARGET = bench_libstl$$TARGET_SUFFIX
|
||||||
|
|
||||||
INCLUDEPATH += $$FOUG_DATAX_ROOT/include
|
INCLUDEPATH += $$GMIO_ROOT/include
|
||||||
|
|
||||||
HEADERS += ../commons/bench_tools.h
|
HEADERS += ../commons/bench_tools.h
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ SOURCES += \
|
|||||||
../commons/bench_tools.c \
|
../commons/bench_tools.c \
|
||||||
main.c
|
main.c
|
||||||
|
|
||||||
DEFINES += FOUG_USE_STDINT_H
|
DEFINES += GMIO_USE_STDINT_H
|
||||||
|
|
||||||
LIBS += -L$$FOUG_DATAX_ROOT/lib -lfougdatax$$TARGET_SUFFIX
|
LIBS += -L$$GMIO_ROOT/lib -lgmio$$TARGET_SUFFIX
|
||||||
QMAKE_RPATHDIR += $$FOUG_DATAX_ROOT/lib
|
QMAKE_RPATHDIR += $$GMIO_ROOT/lib
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <datax_core/error.h>
|
#include <gmio_core/error.h>
|
||||||
#include <datax_stl/stl_io.h>
|
#include <gmio_stl/stl_io.h>
|
||||||
|
|
||||||
#include "../commons/bench_tools.h"
|
#include "../commons/bench_tools.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -12,20 +12,20 @@ typedef struct my_igeom
|
|||||||
|
|
||||||
static void dummy_process_triangle(void* cookie,
|
static void dummy_process_triangle(void* cookie,
|
||||||
uint32_t triangle_id,
|
uint32_t triangle_id,
|
||||||
const foug_stl_triangle_t* triangle)
|
const gmio_stl_triangle_t* triangle)
|
||||||
{
|
{
|
||||||
my_igeom_t* my_igeom = (my_igeom_t*)(cookie);
|
my_igeom_t* my_igeom = (my_igeom_t*)(cookie);
|
||||||
if (my_igeom != NULL)
|
if (my_igeom != NULL)
|
||||||
++(my_igeom->facet_count);
|
++(my_igeom->facet_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void libstl_foug_stlb_read(const char* filepath)
|
static void libstl_gmio_stlb_read(const char* filepath)
|
||||||
{
|
{
|
||||||
/* uint8_t stack_buff[30 * 1024]; */
|
/* uint8_t stack_buff[30 * 1024]; */
|
||||||
|
|
||||||
my_igeom_t cookie;
|
my_igeom_t cookie;
|
||||||
foug_transfer_t trsf;
|
gmio_transfer_t trsf;
|
||||||
foug_stl_geom_creator_t geom_creator;
|
gmio_stl_mesh_creator_t mesh_creator;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
FILE* file = fopen(filepath, "rb");
|
FILE* file = fopen(filepath, "rb");
|
||||||
@ -35,20 +35,20 @@ static void libstl_foug_stlb_read(const char* filepath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cookie.facet_count = 0;
|
cookie.facet_count = 0;
|
||||||
memset(&geom_creator, 0, sizeof(foug_stl_geom_creator_t));
|
memset(&mesh_creator, 0, sizeof(gmio_stl_mesh_creator_t));
|
||||||
geom_creator.cookie = &cookie;
|
mesh_creator.cookie = &cookie;
|
||||||
geom_creator.add_triangle_func = dummy_process_triangle;
|
mesh_creator.add_triangle_func = dummy_process_triangle;
|
||||||
|
|
||||||
memset(&trsf, 0, sizeof(foug_transfer_t));
|
memset(&trsf, 0, sizeof(gmio_transfer_t));
|
||||||
foug_stream_set_stdio(&trsf.stream, file);
|
gmio_stream_set_stdio(&trsf.stream, file);
|
||||||
trsf.buffer = (uint8_t*)malloc(512 * 1024);
|
trsf.buffer = (uint8_t*)malloc(512 * 1024);
|
||||||
trsf.buffer_size = 512 * 1024;
|
trsf.buffer_size = 512 * 1024;
|
||||||
/* trsf.buffer = stack_buff;
|
/* trsf.buffer = stack_buff;
|
||||||
trsf.buffer_size = 24 * 1024; */
|
trsf.buffer_size = 24 * 1024; */
|
||||||
|
|
||||||
result = foug_stlb_read(&geom_creator, &trsf, FOUG_LITTLE_ENDIAN);
|
result = gmio_stlb_read(&mesh_creator, &trsf, GMIO_LITTLE_ENDIAN);
|
||||||
if (foug_datax_error(result))
|
if (gmio_error(result))
|
||||||
fprintf(stderr, "foug_stlb_read() error %i", result);
|
fprintf(stderr, "gmio_stlb_read() error %i", result);
|
||||||
|
|
||||||
fprintf(stdout, "Facet count: %i\n", cookie.facet_count);
|
fprintf(stdout, "Facet count: %i\n", cookie.facet_count);
|
||||||
|
|
||||||
@ -56,9 +56,9 @@ static void libstl_foug_stlb_read(const char* filepath)
|
|||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void libstl_foug_stla_read(const char* filepath)
|
static void libstl_gmio_stla_read(const char* filepath)
|
||||||
{
|
{
|
||||||
foug_transfer_t trsf;
|
gmio_transfer_t trsf;
|
||||||
int result;
|
int result;
|
||||||
FILE* file;
|
FILE* file;
|
||||||
|
|
||||||
@ -68,14 +68,14 @@ static void libstl_foug_stla_read(const char* filepath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&trsf, 0, sizeof(foug_transfer_t));
|
memset(&trsf, 0, sizeof(gmio_transfer_t));
|
||||||
foug_stream_set_stdio(&trsf.stream, file);
|
gmio_stream_set_stdio(&trsf.stream, file);
|
||||||
trsf.buffer = (char*)malloc(512 * 1024);
|
trsf.buffer = (char*)malloc(512 * 1024);
|
||||||
trsf.buffer_size = 512 * 1024;
|
trsf.buffer_size = 512 * 1024;
|
||||||
|
|
||||||
result = foug_stla_read(NULL, &trsf, 0);
|
result = gmio_stla_read(NULL, &trsf, 0);
|
||||||
if (foug_datax_error(result))
|
if (gmio_error(result))
|
||||||
fprintf(stderr, "foug_stla_read() error %i", result);
|
fprintf(stderr, "gmio_stla_read() error %i", result);
|
||||||
|
|
||||||
/* fprintf(stdout, "Facet count: %i\n", igeom.facet_count); */
|
/* fprintf(stdout, "Facet count: %i\n", igeom.facet_count); */
|
||||||
|
|
||||||
@ -88,9 +88,9 @@ int main(int argc, char** argv)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (strcmp(argv[1], "--stla") == 0)
|
if (strcmp(argv[1], "--stla") == 0)
|
||||||
benchmark(&libstl_foug_stla_read, "foug_stla_read()", argc - 2, argv + 2);
|
benchmark(&libstl_gmio_stla_read, "gmio_stla_read()", argc - 2, argv + 2);
|
||||||
else if (strcmp(argv[1], "--stlb") == 0)
|
else if (strcmp(argv[1], "--stlb") == 0)
|
||||||
benchmark(&libstl_foug_stlb_read, "foug_stlb_read()", argc - 2, argv + 2);
|
benchmark(&libstl_gmio_stlb_read, "gmio_stlb_read()", argc - 2, argv + 2);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user