提交 045b9e7a 编写于 作者: 饶先宏's avatar 饶先宏

202108141451 de bug

上级 c6cc5cc9
......@@ -101,7 +101,7 @@ DEFINE_FUNC(cncell_coeffbuf_deinit, "") {
free(pobj->databuf);
} END_DEFINE_FUNC
DEFINE_FUNC(cncell_coeffbuf_gen_info, "") {
DEFINE_FUNC(cncell_coeffbuf_gen_info, "nwReset") {
if (pobj->header_loaded == 0) {
struct sCoeffFileHeader * pFileHeader = (struct sCoeffFileHeader *)pobj->databuf;
vput(bCoeffOffset, pFileHeader->groupInfo[0].offset);
......@@ -120,7 +120,7 @@ DEFINE_FUNC(cncell_coeffbuf_gen_info, "") {
}
} END_DEFINE_FUNC
DEFINE_FUNC(cncell_coeffbuf_gen_CoeffRead, "read") {
DEFINE_FUNC(cncell_coeffbuf_gen_CoeffRead, "read, readaddr") {
vput(wCoeffReadValid, 0);
if (vget(read)) {
vput(bCoeffReadData, *(unsigned int*)&(pobj->databuf[vget(readaddr)]));
......@@ -129,7 +129,8 @@ DEFINE_FUNC(cncell_coeffbuf_gen_CoeffRead, "read") {
} END_DEFINE_FUNC
DEFINE_FUNC(cncell_coeffbuf_gen_read_reg, "wCoeffRead, bCoeffReadAddr") {
vput(read, vget(wCoeffRead));
int read = vget(wCoeffRead);
vput(read, read);
vput(readaddr, vget(bCoeffReadAddr));
} END_DEFINE_FUNC
......
......@@ -109,7 +109,7 @@ DEFINE_FUNC(cnncell_dataoutput_output, "") {
for (i = 0; i < 5; i++) {
printf("%0.4f %s\n", items[i].p, items[i].label);
}
return 0;
exit(0);
} END_DEFINE_FUNC
DEFINE_FUNC(cnncell_dataoutput_clktick, "reset, nwReset") {
......
......@@ -183,7 +183,6 @@ DEFINE_FUNC(cnncell_innerproduct_clktick, "") {
if (vget(nwReset) == 0) {
vput(state, READ_COEFF);
vput(index, 0);
vput(reset, 0);
}
else {
vput(reset, 1);
......@@ -280,7 +279,7 @@ DEFINE_FUNC(cnncell_innerproduct_gen_output_read, "reset, state, wDataReadValid"
}
} END_DEFINE_FUNC
DEFINE_FUNC(cnncell_innerproduct_gen_output_write, "index, state, wDataWriteEanble") {
DEFINE_FUNC(cnncell_innerproduct_gen_output_write, "index, state, wDataWriteEnable") {
int index;
index = vget(index);
vput(wDataWrite, 0);
......
......@@ -53,7 +53,7 @@ static int running = 1;
int cnnInit();
int StopRunning()
int SimStop()
{
running = 0;
return 0;
......
......@@ -120,7 +120,8 @@ typedef struct sModuleVariable {
char* depend_list;
PointerArray functions; /* 依赖它的函数 */
PointerArray variables; /* 依赖它的变量 */
int updatedisset;
PointerArray dependvar;
long long updatedisset;
int genfuncindex;
#if USEBIGINT
IBigNumber** data;
......@@ -147,7 +148,7 @@ typedef struct sModuleVariable {
#endif
THREADLOCK lock;
int updatefunc;
long updatefunc;
}ModuleVariable;
typedef struct sModuleFunction {
......@@ -251,7 +252,6 @@ ModuleFunction* functionCreateFunc(MODULE_FUNC func, void * pobj);
ModuleFunction* functionCreateGetValue(ModuleVariable * var);
int functionDestroy(ModuleFunction* func);
//int functionCallAndSetNone(ModuleFunction* func);
#define functionCallAndSetNone(obj) \
do { \
ModuleFunction * func = (ModuleFunction *)obj; \
......
......@@ -73,20 +73,6 @@ ModuleFunction* functionCreateGetValue(ModuleVariable* var)
return function;
}
static int gen_none(void* p, void* v)
{
return 0;
}
/*
int functionCallAndSetNone(ModuleFunction* func)
{
MODULE_FUNC genfunc;
genfunc = LOCKED_SWAP_POINTER(func->cur_func, gen_none);
return genfunc(func->pobj, func->var);
}
*/
int functionDestroy(ModuleFunction* func)
{
if (func == NULL)
......
......@@ -65,22 +65,6 @@ sGeneralModule* hdl4seModuleGetData(HOBJECT object)
FILE* recordfileGet();
void recordfileRelease();
inline static void hdl4seUpdateVariableNone(ModuleVariable* var)
{
}
inline static void hdl4seUpdateVariableGenFunc(ModuleVariable* var)
{
functionCallAndSetNone(var->moduledata->funcs.array[var->genfuncindex]);
var->updatefunc = 0;
}
inline static void hdl4seUpdateVariableGetValue(ModuleVariable* var)
{
hdl4se_module_GetValue(&var->module->data, var->moduleportindex, var->width, var);
var->updatefunc = 0;
}
#if HDL4SE_DEBUG
#define UpdateVariable(v) \
......@@ -108,19 +92,21 @@ do { \
do { \
if (v->type != VTYPE_REG) { \
int updatefunc; \
updatefunc = LOCKED_COMP_SWAP(v->updatefunc, VUF_UPDATING, VUF_WAITUPDATE); \
threadlockLock(v->lock); \
updatefunc = v->updatefunc; \
if (updatefunc != VUF_UPDATED) { \
if (updatefunc == VUF_WAITUPDATE) { \
if (v->genfuncindex >= 0) { \
functionCallAndSetNone(v->moduledata->funcs.array[v->genfuncindex]); \
LOCKED_SWAP(v->updatefunc, VUF_UPDATED); \
v->updatefunc = VUF_UPDATED; \
} \
else if (v->module != NULL) { \
hdl4se_module_GetValue(&v->module->data, v->moduleportindex, v->width, v); \
LOCKED_SWAP(v->updatefunc, VUF_UPDATED); \
v->updatefunc = VUF_UPDATED; \
} \
} \
} \
threadlockUnlock(v->lock); \
} \
} while (0)
#else
......@@ -128,19 +114,18 @@ do { \
do { \
if (v->type != VTYPE_REG) { \
int updatefunc; \
updatefunc = LOCKED_COMP_SWAP(v->updatefunc, VUF_UPDATING, VUF_WAITUPDATE); \
if (updatefunc != VUF_UPDATED) { \
if (LOCKED_COMP_SWAP(v->updatefunc, VUF_UPDATING, VUF_WAITUPDATE) != VUF_UPDATED) {\
threadlockLock(v->lock); \
if (updatefunc == VUF_WAITUPDATE) { \
updatefunc = v->updatefunc; \
if (updatefunc == VUF_UPDATING) { \
if (v->genfuncindex >= 0) { \
functionCallAndSetNone(v->moduledata->funcs.array[v->genfuncindex]); \
LOCKED_SWAP(v->updatefunc, VUF_UPDATED); \
} \
else if (v->module != NULL) { \
hdl4se_module_GetValue(&v->module->data, v->moduleportindex, v->width, v); \
LOCKED_SWAP(v->updatefunc, VUF_UPDATED); \
} \
} \
v->updatefunc = VUF_UPDATED; \
threadlockUnlock(v->lock); \
} \
} \
......@@ -609,9 +594,17 @@ static int hdl4se_set_depend_variable(ModuleVariable* v, ModuleVariable* depend)
int i;
for (i = 0; i < depend->variables.itemcount; i++) {
if (v == depend->variables.array[i])
return i;
break;
}
if (i == depend->variables.itemcount)
pointerarrayAddItem(&depend->variables, v);
for (i = 0; i < v->dependvar.itemcount; i++) {
if (depend == v->dependvar.array[i])
break;
}
pointerarrayAddItem(&depend->variables, v);
if (i == v->dependvar.itemcount)
pointerarrayAddItem(&v->dependvar, depend);
return i;
}
......@@ -675,35 +668,69 @@ int hdl4se_module_ClkTick(sGeneralModule* pobj)
continue;
var->updatedisset = 0;
if (var->type == VTYPE_REG) {
if (var->genfuncindex >= 0) {
threadlockLock(var->lock);
functionCallAndSetNone(var->moduledata->funcs.array[var->genfuncindex]);
threadlockUnlock(var->lock);
}
int updatefunc;
updatefunc = var->updatefunc;
if (updatefunc != VUF_UPDATED)
{
if (var->genfuncindex >= 0) {
threadlockLock(var->lock);
functionCallAndSetNone(var->moduledata->funcs.array[var->genfuncindex]);
threadlockUnlock(var->lock);
}
else if (var->module != NULL) {
threadlockLock(var->lock);
hdl4se_module_GetValue(&var->module->data, var->moduleportindex, var->width, var);
threadlockUnlock(var->lock);
}
var->updatefunc = VUF_UPDATED;
}
}
}
return 0;
}
#define LOCKED_UPDATE 0
#if LOCKED_UPDATE
int hdl4se_var_set_update(ModuleVariable* v)
{
int i;
if (v == NULL)
return 0;
if (LOCKED_SWAP(v->updatedisset, v->updatedisset)) {
if (LOCKED_SWAP(v->updatedisset, 1)) {
return 0;
}
#if DEBUGDEPEND
printf("->%s.%s", v->moduledata->name, v->name);
#endif
LOCKED_SWAP(v->updatedisset, 1);
if (v->type != VTYPE_REG && (v->genfuncindex >= 0 || v->module != NULL) )
if (v->genfuncindex >= 0 || v->module != NULL)
LOCKED_SWAP(v->updatefunc, VUF_WAITUPDATE);
for (i = 0; i < v->variables.itemcount; i++) {
hdl4se_var_set_update((ModuleVariable *)v->variables.array[i]);
}
return 0;
}
#else
int hdl4se_var_set_update(ModuleVariable* v)
{
int i;
if (v == NULL)
return 0;
if (v->updatedisset) {
return 0;
}
v->updatedisset = 1;
#if DEBUGDEPEND
printf("->%s.%s", v->moduledata->name, v->name);
#endif
if (v->genfuncindex >= 0 || v->module != NULL)
v->updatefunc = VUF_WAITUPDATE;
for (i = 0; i < v->variables.itemcount; i++) {
hdl4se_var_set_update((ModuleVariable*)v->variables.array[i]);
}
return 0;
}
#endif
#define DEPEND_OPT 1
......@@ -724,8 +751,8 @@ int hdl4se_module_Setup(sGeneralModule* pobj)
if (var->data != var->data_reg) {
var->data = var->data_reg;
#endif
var->updatefunc = VUF_UPDATED;
#if DEPEND_OPT
hdl4se_var_set_update(var);
#endif
#if DEBUGDEPEND
......@@ -734,7 +761,7 @@ int hdl4se_module_Setup(sGeneralModule* pobj)
}
}
#if DEPEND_OPT == 0
else if (var->genfuncindex >= 0) {
if (var->genfuncindex >= 0) {
var->updatefunc = VUF_WAITUPDATE;
}
else if (var->module != NULL) {
......@@ -887,6 +914,9 @@ static int hdl4se_set_depend_variable_list(ModuleVariable* v)
break;
}
}
if (i == v->moduledata->variables.itemcount) {
printf("%s, depend %s can not found\n", v->name, token);
}
token = strtok(NULL, ", ");
}
return 0;
......
......@@ -55,6 +55,7 @@ ModuleVariable* variableCreate(int type, int width, int portdirect, int isunsign
ModuleVariable* var = (ModuleVariable*)mt_malloc(sizeof(ModuleVariable));
if (var == NULL)
return NULL;
memset(var, 0, sizeof(ModuleVariable));
// var->index = -1;
var->type = type;
var->width = width;
......@@ -75,6 +76,7 @@ ModuleVariable* variableCreate(int type, int width, int portdirect, int isunsign
var->data = 0;
pointerarrayInit(&var->functions);
pointerarrayInit(&var->variables);
pointerarrayInit(&var->dependvar);
var->data_reg = 0;
#if USEBIGINT
{
......@@ -98,6 +100,7 @@ int variableDestroy(ModuleVariable* var)
objectRelease(var->module);
pointerarrayDestroy(&var->functions, NULL);
pointerarrayDestroy(&var->variables, NULL);
pointerarrayDestroy(&var->dependvar, NULL);
#if USEBIGINT
objectRelease(var->data);
objectRelease(var->data_reg);
......
......@@ -109,8 +109,6 @@ static int hdl4sesim_gen_wClk(sHDL4SESim* pobj)
return 0;
}
static int hdl4sesimCreate(const PARAMITEM* pParams, int paramcount, HOBJECT* pObject)
{
sHDL4SESim* pobj;
......@@ -201,31 +199,39 @@ static int hdl4sesim_collect_module(HOBJECT module, sHDL4SESim* pobj)
return 0;
}
#define REORDER_OPT 1
static int hdl4sesim_hdl4se_simulator_SetTopModule(HOBJECT object, HOBJECT topmodule)
{
int i, j;
sHDL4SESim* pobj;
void* a[1024];
pobj = (sHDL4SESim*)objectThis(object);
objectQueryInterface(topmodule, IID_HDL4SEMODULE, (const void**)&pobj->topmodule);
hdl4semoduleTraversal(pobj->topmodule, hdl4sesim_collect_module, pobj);
for (i = 0; i < 16; i++) {
for (j = 0; j < 64; j++) {
int k;
k = j * 16 + i;
if (k < pobj->multithreadmodules.itemcount)
a[k] = pobj->singlethreadmodules.array[k];
#if REORDER_OPT
{
void* a[1024];
for (i = 0; i < 16; i++) {
for (j = 0; j < 64; j++) {
int k;
k = j * 16 + i;
if (k < pobj->multithreadmodules.itemcount)
a[k] = pobj->multithreadmodules.array[k];
}
}
}
for (i = 0; i < pobj->multithreadmodules.itemcount; i++) {
pobj->singlethreadmodules.array[i] = a[i];
for (i = 0; i < pobj->multithreadmodules.itemcount; i++) {
pobj->multithreadmodules.array[i] = a[i];
}
}
#endif
/*连接topmodule到sim模块,0.wClk, 1.nwReset*/
hdl4se_module_ConnectInput(&pobj->topmodule->data, 0, object, 0);
hdl4se_module_ConnectInput(&pobj->topmodule->data, 1, object, 1);
return 0;
}
......@@ -233,12 +239,11 @@ static int hdl4sesim_hdl4se_simulator_SetReset(HOBJECT object, int reset)
{
sHDL4SESim* pobj;
pobj = (sHDL4SESim*)objectThis(object);
//pobj->reset = reset;
vput(reset, reset);
return 0;
}
#define THREADCOUNT 4
#define THREADCOUNT 8
static int hdl4sesim_hdl4se_simulator_ClkTick(HOBJECT object)
{
......@@ -257,6 +262,19 @@ static int hdl4sesim_hdl4se_simulator_ClkTick(HOBJECT object)
return 0;
}
static int checkmodule(sGeneralModule* m)
{
int i;
for (i = 0; i < m->variables.itemcount; i++) {
ModuleVariable* v = (ModuleVariable*)m->variables.array[i];
if (v->type != VTYPE_REG && (v->genfuncindex >= 0 || v->module != NULL)) {
if (v->updatefunc != VUF_WAITUPDATE) {
printf("variable %s.%s not updated\n", m->name, v->name);
}
}
}
}
static int hdl4sesim_hdl4se_simulator_Setup(HOBJECT object)
{
sHDL4SESim* pobj;
......@@ -276,6 +294,11 @@ static int hdl4sesim_hdl4se_simulator_Setup(HOBJECT object)
for (i = 0; i < pobj->multithreadmodules.itemcount; i++) {
hdl4se_module_Setup(&((IHDL4SEModuleVar*)(pobj->multithreadmodules.array[i]))->data);
}
#if 0
for (i = 0; i < pobj->multithreadmodules.itemcount; i++) {
checkmodule(&((IHDL4SEModuleVar*)(pobj->multithreadmodules.array[i]))->data);
}
#endif
return 0;
}
......@@ -383,222 +406,398 @@ clocks: 1835008, TSPD=2894.334385cps, LSPD=3120.761905cps
i9 10900 32G
threadcount=32
clocks: 1867776, TSPD=8768.901408cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=28086.857143cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=31
DEPEND_OPT=1
clocks: 1769472, TSPD=27648.000000cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=30
DEPEND_OPT=1
clocks: 1769472, TSPD=26410.029851cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=29
DEPEND_OPT=1
clocks: 1769472, TSPD=27648.000000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=28
DEPEND_OPT=1
clocks: 1769472, TSPD=27648.000000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=27
DEPEND_OPT=1
clocks: 1769472, TSPD=27222.646154cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=26
DEPEND_OPT=1
clocks: 1769472, TSPD=26810.181818cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=25
DEPEND_OPT=1
clocks: 1769472, TSPD=28086.857143cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=8763.534884cps, LSPD=8192.000000cps
threadcount=24
clocks: 1867776, TSPD=8979.692308cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=27648.000000cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=23
DEPEND_OPT=1
clocks: 1769472, TSPD=29491.200000cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=22
DEPEND_OPT=1
clocks: 1769472, TSPD=27648.000000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=21
DEPEND_OPT=1
clocks: 1769472, TSPD=28086.857143cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=8972.190476cps, LSPD=8192.000000cps
threadcount=20
clocks: 1867776, TSPD=8607.262673cps, LSPD=16384.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=29007.737705cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=19
clocks: 1769472, TSPD=31043.368421cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
DEPEND_OPT=1
clocks: 1769472, TSPD=28539.870968cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=8603.470320cps, LSPD=8192.000000cps
threadcount=18
clocks: 1867776, TSPD=9066.873786cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=29491.200000cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9102.222222cps, LSPD=16384.000000cps
ordered:
clocks: 1867776, TSPD=9246.415842cps, LSPD=8192.000000cps
threadcount=17
DEPEND_OPT=1
clocks: 1769472, TSPD=29991.050847cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9236.078431cps, LSPD=8192.000000cps
threadcount=16
clocks: 1867776, TSPD=9433.212121cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=31043.368421cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=15
DEPEND_OPT=1
clocks: 1769472, TSPD=32172.218182cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=14
DEPEND_OPT=1
clocks: 1769472, TSPD=32172.218182cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=13
DEPEND_OPT=1
clocks: 1769472, TSPD=33386.264151cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9468.140704cps, LSPD=16384.000000cps
threadcount=12
clocks: 1867776, TSPD=9578.338462cps, LSPD=16384.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=33386.264151cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
LOCKED_UPDATE=0 DEPEND_OPT=1
clocks: 1769472, TSPD=36111.673469cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9564.263959cps, LSPD=8192.000000cps
threadcount=11
clocks: 1867776, TSPD=9338.880000cps, LSPD=16384.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=33386.264151cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9327.524752cps, LSPD=8192.000000cps
threadcount=10
clocks: 1867776, TSPD=9728.000000cps, LSPD=8192.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1
clocks: 1769472, TSPD=35389.440000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9712.164948cps, LSPD=8192.000000cps
threadcount=9
clocks: 1867776, TSPD=9728.000000cps, LSPD=16384.000000cps
threadcount=10
DEPEND_OPT=1
clocks: 1769472, TSPD=34028.307692cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9712.164948cps, LSPD=8192.000000cps
ordered:
clocks: 1867776, TSPD=9830.400000cps, LSPD=8192.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1
clocks: 1769472, TSPD=36111.673469cps, LSPD=65536.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9864.712042cps, LSPD=16384.000000cps
ordered+fifo++
clocks: 1867776, TSPD=9882.412698cps, LSPD=8192.000000cps
threadcount=9
DEPEND_OPT=1
clocks: 1769472, TSPD=34695.529412cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9916.631579cps, LSPD=16384.000000cps
ordered+fifo++++
clocks: 1802240, TSPD=9902.417582cps, LSPD=8192.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1
clocks: 1769472, TSPD=36864.000000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=9937.836066cps, LSPD=16384.000000cps
get_func_and_set_none:
clocks: 1802240, TSPD=10298.514286cps, LSPD=8192.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1 REORDER_OPT=1
clocks: 1769472, TSPD=37648.340426cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=10274.711864cps, LSPD=8192.000000cps
fifo gen_depend:
clocks: 1802240, TSPD=8966.368159cps, LSPD=8192.000000cps
threadcount=8
DEPEND_OPT=1
clocks: 1769472, TSPD=35389.440000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=8958.738916cps, LSPD=8192.000000cps
gen_depend + get_func_and_set_none:
clocks: 1802240, TSPD=9586.382979cps, LSPD=16384.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1
clocks: 1769472, TSPD=35389.440000cps, LSPD=65536.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=9571.705263cps, LSPD=8192.000000cps
usebitint==0
clocks: 1802240, TSPD=14080.000000cps, LSPD=8192.000000cps
LOCKED_UPDATE=0 DEPEND_OPT=1 REORDER_OPT=1
clocks: 1769472, TSPD=36864.000000cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1818624, TSPD=14097.860465cps, LSPD=16384.000000cps
threadcount=8
clocks: 1867776, TSPD=9529.469388cps, LSPD=16384.000000cps
threadcount=7
DEPEND_OPT=1
clocks: 1769472, TSPD=33386.264151cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=9515.959596cps, LSPD=8192.000000cps
threadcount=6
clocks: 1867776, TSPD=8810.264151cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=32172.218182cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=5
DEPEND_OPT=1
clocks: 1769472, TSPD=28539.870968cps, LSPD=32768.000000cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=8845.821596cps, LSPD=16384.000000cps
threadcount=4
clocks: 1867776, TSPD=7382.513834cps, LSPD=8192.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=25644.521739cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
threadcount=3
DEPEND_OPT=1
clocks: 1769472, TSPD=22118.400000cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=7388.862745cps, LSPD=8192.000000cps
threadcount=2
clocks: 1867776, TSPD=4522.460048cps, LSPD=4096.000000cps
DEPEND_OPT=1
clocks: 1769472, TSPD=18055.836735cps, LSPD=21845.333333cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=4529.230769cps, LSPD=5461.333333cps
threadcount=0
clocks: 1867776, TSPD=2551.606557cps, LSPD=2730.666667cps
threadcount=1
DEPEND_OPT=1
clocks: 1769472, TSPD=10922.666667cps, LSPD=10922.666667cps
softmax_168 complete
0.4901 n03085013 computer keyboard, keypad
0.1591 n04264628 space bar
0.0543 n04074963 remote control, remote
0.0439 n03832673 notebook, notebook computer
0.0356 n04505470 typewriter keyboard
clocks: 1884160, TSPD=2549.607578cps, LSPD=2340.571429cps
*/
\ No newline at end of file
......@@ -54,6 +54,7 @@ int pointerarrayInit(PointerArray* array);
int pointerarrayAddItem(PointerArray* array, void* item);
int pointerarraySetItem(PointerArray* array, int index, void* item);
int pointerarrayDestroy(PointerArray* array, void (*itemDestroy)(void* item));
int pointerarrayRemoveItem(PointerArray* array, int (*RemoveIt)(void * item), void (*itemDestroy)(void* item));
#endif
......
......@@ -85,6 +85,22 @@ int pointerarraySetItem(PointerArray* array, int index, void* item)
return 0;
}
int pointerarrayRemoveItem(PointerArray* array, int (*RemoveIt)(void* item), void (*itemDestroy)(void* item))
{
int i, j;
j = 0;
for (i = 0; i < array->itemcount; i++) {
if (RemoveIt(array->array[i])) {
if (itemDestroy)
itemDestroy(array->array[i]);
}
else {
array->array[j++] = array->array[i];
}
}
array->itemcount = j;
return array->itemcount;
}
int pointerarrayDestroy(PointerArray* array, void (*itemDestroy)(void* item))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册