这篇教程C++ trace_init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中trace_init函数的典型用法代码示例。如果您正苦于以下问题:C++ trace_init函数的具体用法?C++ trace_init怎么用?C++ trace_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了trace_init函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: chSysInit/** * @brief ChibiOS/RT initialization. * @details After executing this function the current instructions stream * becomes the main thread. * @pre Interrupts must be still disabled when @p chSysInit() is invoked * and are internally enabled. * @post The main thread is created with priority @p NORMALPRIO. * @note This function has special, architecture-dependent, requirements, * see the notes into the various port reference manuals. * * @special */void chSysInit(void) { static Thread mainthread; port_init(); scheduler_init(); vt_init();#if CH_USE_MEMCORE core_init();#endif#if CH_USE_HEAP heap_init();#endif#if CH_DBG_ENABLE_TRACE trace_init();#endif /* Now this instructions flow becomes the main thread.*/ setcurrp(_thread_init(&mainthread, NORMALPRIO)); currp->p_state = THD_STATE_CURRENT; chSysEnable();#if !CH_NO_IDLE_THREAD /* This thread has the lowest priority in the system, its role is just to serve interrupts in its context while keeping the lowest energy saving mode compatible with the system status.*/ chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO, (tfunc_t)_idle_thread, NULL);#endif}
开发者ID:Amirelecom,项目名称:brush-v1,代码行数:41,
示例2: supervisor_initvoid supervisor_init(void){ trace_init(); thinkos_thread_create_inf((void *)supervisor_task, (void *)NULL, &supervisor_inf);}
开发者ID:bobmittmann,项目名称:thinkos,代码行数:7,
示例3: mxosrvr_init_seabed_trace_dllint mxosrvr_init_seabed_trace_dll(){ bool bret = true; const char *gp_mxosrvr_trace_filename = "mxosrvr_trace_"; const char *gp_mxosrvr_env_trace_enable = "MXOSRVR_TRACE_ENABLE"; // enable trace const char *gp_mxosrvr_env_trace_ems = "MXOSRVR_TRACE_EMS"; // trace what used to be sent to the legacy ems collector const char *gp_mxosrvr_env_trace_legacy = "MXOSRVR_TRACE_LEGACY"; bool gv_mxosrvr_trace_enable = false; msg_getenv_bool(gp_mxosrvr_env_trace_enable, &gv_mxosrvr_trace_enable); if(gv_mxosrvr_trace_enable) { msg_getenv_bool(gp_mxosrvr_env_trace_ems, &gv_trace_ems_dll); msg_getenv_bool(gp_mxosrvr_env_trace_legacy, &gv_trace_legacy_dll); trace_init((char*)gp_mxosrvr_trace_filename, true, NULL, false); } return 0;}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:25,
示例4: app_startvoid app_start(int, char **){ // set the baud rate for output printing get_stdio_serial().baud(YOTTA_CFG_K64F_BORDER_ROUTER_BAUD); // set heap size and memory error handler for this application ns_dyn_mem_init(app_stack_heap, APP_DEFINED_HEAP_SIZE, app_heap_error_handler, 0); trace_init(); // set up the tracing library set_trace_print_function(trace_printer); set_trace_config(TRACE_MODE_COLOR | TRACE_ACTIVE_LEVEL_DEBUG | TRACE_CARRIAGE_RETURN); const char *mac_src = STR(YOTTA_CFG_K64F_BORDER_ROUTER_BACKHAUL_MAC_SRC); if (strcmp(mac_src, "BOARD") == 0) { /* Setting the MAC Address from UID (A yotta function) * Takes UID Mid low and UID low and shuffles them around. */ mbed_mac_address((char *)mac); } else if (strcmp(mac_src, "CONFIG") == 0) { /* MAC is defined by the user through yotta configuration */ const uint8_t mac48[] = YOTTA_CFG_K64F_BORDER_ROUTER_BACKHAUL_MAC; for (uint32_t i = 0; i < sizeof(mac); ++i) { mac[i] = mac48[i]; } } // run LED toggler in the Minar scheduler minar::Scheduler::postCallback(mbed::util::FunctionPointer0<void> (toggle_led1).bind()).period(minar::milliseconds(500)); tr_info("Starting K64F border router..."); border_router_start();}
开发者ID:hasnainvirk,项目名称:k64f-border-router,代码行数:34,
示例5: trace_enterinttrace_enter(int fd, char *line, int closed){ struct trace *tmp; int res; assert(fd >= 0); if (trace_refs == NULL || fd >= trace_refsize) { res = trace_init(fd); if (res == -1) goto error; } if ((tmp = TAILQ_LAST(trace_refs[fd], traceq)) != NULL) { if (tmp->closed) trace_free(fd); } if ((tmp = malloc(sizeof(struct trace))) == NULL) goto error; tmp->line = line; tmp->closed = closed; TAILQ_INSERT_TAIL(trace_refs[fd], tmp, next); return (0); error: free(line); return (-1);}
开发者ID:Herysutrisno,项目名称:honeyd,代码行数:32,
示例6: mainint main() { printf("============== Before allocating blocks ==============/n"); display_mallinfo(); MbedClient mbed_client; m2mclient = &mbed_client; trace_init(); set_trace_print_function( trace_printer ); set_trace_config(TRACE_MODE_COLOR|TRACE_ACTIVE_LEVEL_DEBUG|TRACE_CARRIAGE_RETURN); signal(SIGINT, (signalhandler_t)ctrl_c_handle_function); bool result = mbed_client.create_interface(); if(true == result) { printf("/nInterface created/n"); } result = mbed_client.create_bootstrap_object(); if(true == result) { printf("Bootstrap object created"); } result = mbed_client.create_register_object(); if(true == result) { printf("Register object created"); } result = mbed_client.create_device_object(); if(true == result) { printf("/nDevice object created !!/n"); } result = mbed_client.create_generic_object(); if(true == result) { printf("/nGeneric object created/n"); }// printf("Bootstrapping endpoint/n");// mbed_client.test_bootstrap(); printf("Registering endpoint/n"); mbed_client.test_register(); pthread_create(&bootstrap_thread, NULL, &wait_for_bootstrap, (void*) &mbed_client); pthread_create(&observation_thread, NULL, &send_observation, (void*) &mbed_client); pthread_create(&unregister_thread, NULL, &wait_for_unregister, (void*) &mbed_client); pthread_join(bootstrap_thread, NULL); pthread_join(unregister_thread, NULL); pthread_join(observation_thread, NULL); printf("/n============== After freeing blocks ==============/n"); display_mallinfo(); exit(EXIT_SUCCESS);}
开发者ID:Guokai19900920,项目名称:mbed-client,代码行数:60,
示例7: init_m3_state_machinevoid init_m3_state_machine(void){ int i = 0; /* Flush out NVIC interrupts */ for (i=0; i<AM335X_NUM_EXT_INTERRUPTS; i++) { nvic_disable_irq(i); nvic_clear_irq(i); } msg_init(); trace_init(); pm_init(); /* Enable only the MBX IRQ */ nvic_enable_irq(AM335X_IRQ_MBINT0); /* * In the remote case where we disabled the MPU CLOCK * enable it again, no harm in writing to the reg * even if this was not needed */ mpu_enable(); a8_notify(CMD_STAT_PASS);}
开发者ID:eieio,项目名称:am33x-cm3,代码行数:28,
示例8: initr_tracestatic int initr_trace(void){#ifdef CONFIG_TRACE trace_init(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE);#endif return 0;}
开发者ID:CheezeCake,项目名称:edison-u-boot,代码行数:8,
示例9: EXACT_XACTION_BEGINvoid EXACT_XACTION_BEGIN(void) {#ifdef COUNT_OPS tx = 0;#else if (trace==NULL) trace_init(); fprintf(trace, "x/n");#endif}
开发者ID:fenghaitao,项目名称:Harpoon,代码行数:8,
示例10: EXACT_XACTION_ENDvoid EXACT_XACTION_END(void) { if (trace==NULL) trace_init();#ifdef COUNT_OPS fprintf(trace, "%d/n", tx);#else fprintf(trace, "X/n");#endif}
开发者ID:fenghaitao,项目名称:Harpoon,代码行数:8,
示例11: mainint main(int argc, char ** argv){ usb_cdc_class_t * cdc; DCC_LOG_INIT(); DCC_LOG_CONNECT(); DCC_LOG(LOG_TRACE, "1. cm3_udelay_calibrate()"); cm3_udelay_calibrate(); DCC_LOG(LOG_TRACE, "2. thinkos_init()"); thinkos_init(THINKOS_OPT_PRIORITY(8) | THINKOS_OPT_ID(7)); DCC_LOG(LOG_TRACE, "3. io_init()"); io_init(); DCC_LOG(LOG_TRACE, "4. external_bus_init()"); external_bus_init(); DCC_LOG(LOG_TRACE, "5. stdio_init()"); stdio_init(); printf("/n---/n"); DCC_LOG(LOG_TRACE, "6. trace_init()"); trace_init(); DCC_LOG(LOG_TRACE, "7. env_init()"); env_init(); /* create some threads */ DCC_LOG(LOG_TRACE, "8. monitor_init()"); monitor_init(); DCC_LOG(LOG_TRACE, "9. watchdog_init()"); watchdog_init(); DCC_LOG(LOG_TRACE, "10. net_init()"); net_init(); DCC_LOG(LOG_TRACE, "11. pkt_xmt_init()"); pkt_xmt_init(); net_pkt_mode(true); DCC_LOG(LOG_TRACE, "12. console_shell_init()"); console_shell_init(); DCC_LOG(LOG_TRACE, "13. usb_cdc_init()"); usb_cdc_sn_set(*((uint64_t *)STM32F_UID)); cdc = usb_cdc_init(&stm32f_otg_fs_dev, cdc_acm_def_str, cdc_acm_def_strcnt); DCC_LOG(LOG_TRACE, "14. usb_shell()"); for (;;) { usb_shell(cdc); }}
开发者ID:powertang,项目名称:yard-ice,代码行数:57,
示例12: TAvoid TA(EXACT_traceWrite)(struct oobj *obj, int offset, int istran) { VALUETYPE *ptr = (VALUETYPE *)(FIELDBASE(obj) + offset);#ifdef COUNT_OPS if (istran) tx++;#else if (trace==NULL) trace_init(); fprintf(trace, "%c %p %d %d/n", istran ? 'w' : 'W', ptr, (int)sizeof(*ptr), (int)FNI_ObjectSize(obj));#endif}
开发者ID:fenghaitao,项目名称:Harpoon,代码行数:10,
示例13: trace_initu8 *cmd_trace_on(u8 *c){ if (trace_state != 0) return c + 1; else { trace_init(); return c; }}
开发者ID:saucjedi,项目名称:nagi,代码行数:10,
示例14: void *malloc(size_t s) { if(!marker) trace_init(); if(s>0x7fffffff) return 0; size_t *p = real_malloc(s+sizeof(s)); if(!p) return p; *p++ = s; void *result = p; VALGRIND_MEMPOOL_ALLOC(&marker, result, s); return result;}
开发者ID:arielb1,项目名称:arena-malloc,代码行数:10,
示例15: bootimage_initialize__LIBBOOTIMAGE_PUBLIC_API__ struct bootimage* bootimage_initialize(){ /* Allocate and zero memory to store the bootimage struct This will contain metadata for a loaded bootimage */ trace_init(); struct bootimage* bi = calloc(1,sizeof(struct bootimage)); D("bi=%p",bi); return bi ;}
开发者ID:trevd,项目名称:android_external_bootimage_utils,代码行数:11,
示例16: mallocvoid *realloc(void* a, size_t news) { if(!marker) trace_init(); if(!a) return malloc(news); size_t *x = a; --x; size_t olds = *x; void *result = malloc(news); if(!result) return result; memcpy(result, a, olds); free(a); return result;}
开发者ID:arielb1,项目名称:arena-malloc,代码行数:12,
示例17: dres_open/******************** * dres_open ********************/EXPORTED dres_t *dres_open(char *file){ struct stat st; char path[PATH_MAX], *suffix; dres_t *dres; size_t len; int cid; trace_init(); cid = TRACE_DEFAULT_CONTEXT; trace_add_module(cid, &trcdres); /* * try to load the given file if it is found and a regular file */ if (stat(file, &st) == 0 && S_ISREG(st.st_mode)) { if ((dres = dres_load(file)) != NULL || (dres = dres_parse_file(file)) != NULL) return dres; return NULL; } /* * otherwise try to load it with binary and plain suffices */ if ((len = strlen(file)) >= sizeof(path) || len + sizeof(DRES_SUFFIX_BINARY) > sizeof(path) || len + sizeof(DRES_SUFFIX_PLAIN) > sizeof(path)) { errno = EOVERFLOW; return NULL; } strcpy(path, file); suffix = path + len; *suffix++ = '.'; strcpy(suffix, DRES_SUFFIX_BINARY); if ((dres = dres_load(path)) != NULL) return dres; strcpy(suffix, DRES_SUFFIX_PLAIN); return dres_parse_file(path);}
开发者ID:maemo-foss,项目名称:maemo-multimedia-dres,代码行数:52,
示例18: kmain/* This is the C kernel entry point */void kmain(struct multiboot *mboot_header, addr_t initial_stack){ /* Store passed values, and initiate some early things * We want serial log output as early as possible */ kernel_state_flags=0; mtboot = mboot_header; initial_boot_stack = initial_stack; loader_parse_kernel_elf(mboot_header, &kernel_sections);#if CONFIG_MODULES loader_init_kernel_symbols();#endif serial_init(); cpu_early_init();#if CONFIG_MODULES loader_init_modules();#endif syscall_init(); fs_initrd_load(mtboot); cpu_timer_install(1000); cpu_processor_init_1(); /* Now get the management stuff going */ printk(1, "[kernel]: Starting system management/n"); mm_init(mtboot); syslog_init(); parse_kernel_command_line((char *)(addr_t)mtboot->cmdline); tm_init_multitasking(); dm_init(); fs_init(); net_init(); trace_init(); /* Load the rest... */ printk(KERN_MILE, "[kernel]: Kernel is setup (kv=%d, bpl=%d: ok)/n", CONFIG_VERSION_NUMBER, BITS_PER_LONG); printk(KERN_DEBUG, "[kernel]: structure sizes: process=%d bytes, thread=%d bytes, inode=%d bytes/n", sizeof(struct process), sizeof(struct thread), sizeof(struct inode)); cpu_interrupt_set(1); sys_setup(); cpu_processor_init_2(); timer_calibrate();#if CONFIG_SMP if(boot_cpus) cpu_boot_all_aps();#endif tm_clone(0, __init_entry, 0); sys_setsid(); kt_kernel_idle_task();}
开发者ID:dbittman,项目名称:seakernel,代码行数:49,
示例19: mainintmain (int argc, char **argv){ struct addrinfo hints, *res; trace_t trace; set_program_name (argv[0]); /* Parse command line */ iu_argp_init ("traceroute", program_authors); argp_parse (&argp, argc, argv, 0, NULL, NULL); /* Hostname lookup first for better information */ memset (&hints, 0, sizeof (hints)); hints.ai_family = AF_INET; hints.ai_flags = AI_CANONNAME; if ((hostname == NULL) || (*hostname == '/0') || getaddrinfo (hostname, NULL, &hints, &res)) error (EXIT_FAILURE, 0, "unknown host"); memcpy (&dest, res->ai_addr, res->ai_addrlen); dest.sin_port = htons (opt_port); getnameinfo (res->ai_addr, res->ai_addrlen, addrstr, sizeof (addrstr), NULL, 0, NI_NUMERICHOST); printf ("traceroute to %s (%s), %d hops max/n", res->ai_canonname, addrstr, opt_max_hops); freeaddrinfo (res); trace_init (&trace, dest, opt_type); int hop = 1; while (!stop) { if (hop > opt_max_hops) exit (EXIT_SUCCESS); do_try (&trace, hop, opt_max_hops, opt_max_tries); trace_inc_ttl (&trace); trace_inc_port (&trace); hop++; } exit (EXIT_SUCCESS);}
开发者ID:millken,项目名称:zhuxianB30,代码行数:47,
示例20: am335_initint am335_init(void){ int i; /* * Each interrupt has a priority register associated with it * 8 bits... only 7:6:5:4 are available for SA * out of the 16 levels here... using a priority grouping * these 4 bits can be further split into preempt priority * and subpriority fields */ scr_enable_sleepdeep(); scr_enable_sleeponexit(); /* Disable all the external interrupts */ for (i=0; i < CM3_NUM_EXT_INTERRUPTS; i++) nvic_disable_irq(i); /* Disable Tamper swakeup, a new addition for AM43XX SOCs */ if (soc_id == AM43XX_SOC_ID) nvic_disable_irq(CM3_IRQ_TPM_WAKE); /* Clean the IPC registers */ m3_param_reset(); trace_init(); pm_reset(); setup_soc(); /* Enable only the MBX IRQ */ nvic_enable_irq(CM3_IRQ_MBINT0); nvic_enable_irq(53); m3_firmware_version(); /* TODO: Enable PRCM_INT2 with a dummy handler */ /* Notify A8 of init completion */ a8_notify(CMD_STAT_PASS); /* Ok we are done here */ return 0;}
开发者ID:RobertCNelson,项目名称:am33x-cm3,代码行数:46,
示例21: app_startvoid app_start(int, char **){ char if_desciption[] = "6LoWPAN_NODE"; pc.baud(115200); //Setting the Baud-Rate for trace output ns_dyn_mem_init(app_stack_heap, APP_DEFINED_HEAP_SIZE, app_heap_error_handler,0); randLIB_seed_random(); platform_timer_enable(); eventOS_scheduler_init(); trace_init(); set_trace_print_function( trace_printer ); set_trace_config(TRACE_ACTIVE_LEVEL_DEBUG|TRACE_CARRIAGE_RETURN); tr_debug("M /r/n"); net_init_core(); rf_phy_device_register_id = rf_device_register(); net_rf_id = arm_nwk_interface_init(NET_INTERFACE_RF_6LOWPAN, rf_phy_device_register_id, if_desciption); eventOS_event_handler_create(&tasklet_main, ARM_LIB_TASKLET_INIT_EVENT);}
开发者ID:LiyouZhou,项目名称:mbed-thread-jn517x-example,代码行数:18,
示例22: maintenanceTaskvoid maintenanceTask() { System_printf("Main Task started/n"); System_flush();#if 1 /* Enable radio SPI */ spicom_init();#endif#if 1 /* Enable Trace */ trace_init();#endif#if 1 /* Digital io */ dio_init();#endif#ifdef RN_ACTIVE rn_sysbios_init(); rn_module_init(); ap_sim_module_init(); //rn_sysbios_start(); rn_module_start(1); ap_sim_module_start(1); rn_module_start(2); ap_sim_module_start(2);#endif maintenanceMainTask(); /* Should never return but in case*/ Task_exit();}
开发者ID:lundburgerr,项目名称:workspace,代码行数:40,
示例23: mainint main (void){ //set clock divider at 1x CLKPR = 0x80; CLKPR = 0x00; led_init(); trace_init(); usart_init(); InitPins(); stdout = &uart_output; stderr = &uart_output; puts("begin"); test(); puts("end"); for(;;); return 0;}
开发者ID:theepot,项目名称:esc64,代码行数:22,
示例24: mainint main(){ char *env_input; char path[4096]; /* CGI initial print */ printf("Content-type: text/html/n/n"); /* create trace/log */ trace_init("list.log"); /* get GET content from environment variable */ env_input = getenv("QUERY_STRING"); if (env_input == NULL) { trace(WEB, "No env variable: QUERY_STRING./n", NULL); goto exit; } /* extract page number from GET content */ sscanf(env_input, "p=%s", path); /* echo HTML */ cat("head.cat"); printf("file: %s <br/>", basename(path)); printf("[dmath]%s[/dmath]", first_line(path)); cat("neck.cat"); echo_tex_li(path); cat("ass.cat"); cat("tail.cat");exit: /* delete trace/log */ trace_unfree(); trace_uninit(); return 0;}
开发者ID:t-k-,项目名称:OPMES,代码行数:38,
示例25: mesh_system_initvoid mesh_system_init(void){ if (mesh_initialized == false) {#ifndef YOTTA_CFG ns_hal_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, NULL); eventOS_scheduler_mutex_wait(); net_init_core(); eventOS_scheduler_mutex_release();#else ns_dyn_mem_init(app_stack_heap, MBED_MESH_API_HEAP_SIZE, mesh_system_heap_error_handler, NULL); randLIB_seed_random(); platform_timer_enable(); eventOS_scheduler_init(); trace_init(); // trace system needs to be initialized right after eventOS_scheduler_init net_init_core(); /* initialize 6LoWPAN socket adaptation layer */ ns_sal_init_stack();#endif mesh_initialized = true; }}
开发者ID:AlessandroA,项目名称:mbed,代码行数:23,
示例26: trace_write/* Function : trace_write * Description : TAU trace output writer */int trace_write(t_ev** buf, t_ev** cur, x_uint64* last_ti, x_int32 ev, x_uint16 nid, /* -- node id -- */ x_uint16 tid, /* -- thread id -- */ x_int64 par, /* -- event parameter -- */ x_uint64 ti, /* -- time [us] -- */ char *output_path){ static int init_done =0; int retval = 0; /* Check if the buffer is already initialized */ if(*buf == NULL && *cur== NULL){ if((retval = trace_init(buf,cur,ev,nid,tid,par,ti))){ return retval; } }else{ /* * cur is pointing to the last trace event. * We have to advance cur to the next available * space and check for out-of-bound. */ if( (*cur)-(*buf) >= MAX_NUM_TRACE-3 ){ trace_dump_cont(buf, cur, output_path); }else{ /* Advance the current pointer */ *cur = (*cur)+1; } /* Write the trace event */ __trace_write(cur,ev,nid,tid,par,ti); } *last_ti = ti; //printf("DEBUG: trace_write: ev= %d, retval = %d/n", ev,retval); return retval;}
开发者ID:jahil,项目名称:kernel26-patches,代码行数:40,
示例27: dimension//.........这里部分代码省略......... *info = -4; } else if (upper && ldda < max(1,m)) { *info = -4; } if (*info != 0) { magma_xerbla( __func__, -(*info) ); return *info; } for( d=0; d < num_gpus; d++ ) { /* local-n and local-ld */ if (upper) { n_local[d] = ((n/nb)/num_gpus)*nb; if (d < (n/nb)%num_gpus) n_local[d] += nb; else if (d == (n/nb)%num_gpus) n_local[d] += n%nb; } else { n_local[d] = ((m/nb)/num_gpus)*nb; if (d < (m/nb)%num_gpus) n_local[d] += nb; else if (d == (m/nb)%num_gpus) n_local[d] += m%nb; } //magma_setdevice(d); //magma_event_create( &event0[d] ); //magma_event_create( &event1[d] ); //magma_event_create( &event2[d] ); //magma_event_create( &event3[d] ); } magma_setdevice(0); /* == initialize the trace */ trace_init( 1, num_gpus, 3, (magma_queue_t*)stream ); /* Use blocked code. */ if (upper) { /* ---------------------------------------------- */ /* Upper-triangular case */ /* > Compute the Cholesky factorization A = U'*U. */ /* ---------------------------------------------- */ #if defined(PRECISION_d) && defined(STRSM_WORK) /* invert the diagonals * Allocate device memory for the inversed diagonal blocks, size=m*NB */ for( d=0; d < num_gpus; d++ ) { magma_setdevice(d); for( j=0; j < 2; j++ ) { magma_smalloc( &d_dinvA[d][j], nb*nb ); magma_smalloc( &d_x[d][j], n*nb ); cudaMemset(d_dinvA[d][j], 0, nb*nb*sizeof(float)); cudaMemset(d_x[d][j], 0, n*nb*sizeof(float)); } } magma_setdevice(0);#endif for (j=0; j < m; j += nb) { /* Set the GPU number that holds the current panel */ id = (j/nb)%num_gpus; buf = (j/nb)%num_gpus; /* Set the local index where the current panel is */ j_local = j/(nb*num_gpus); jb = min(nb, (m-j));
开发者ID:EmergentOrder,项目名称:magma,代码行数:67,
示例28: dimension//.........这里部分代码省略......... float mzone = MAGMA_S_NEG_ONE; int upper = (uplo == MagmaUpper); magma_int_t j, k, jb, nb, ib, iinfo; *info = 0; if (! upper && uplo != MagmaLower) { *info = -1; } else if (n < 0) { *info = -2; } else if (ldda < max(1,n)) { *info = -4; } if (*info != 0) { magma_xerbla( __func__, -(*info) ); return MAGMA_ERR_ILLEGAL_VALUE; } /* Quick return */ if ( n == 0 ) return MAGMA_SUCCESS; nb = magma_get_ssytrf_nopiv_nb(n); ib = min(32, nb); // inner-block for diagonal factorization magma_queue_t orig_stream; magmablasGetKernelStream( &orig_stream ); magma_queue_t stream[2]; magma_event_t event; magma_queue_create(&stream[0]); magma_queue_create(&stream[1]); magma_event_create( &event ); trace_init( 1, 1, 2, stream ); // CPU workspace float *A; if (MAGMA_SUCCESS != magma_smalloc_pinned( &A, nb*nb )) { *info = MAGMA_ERR_HOST_ALLOC; return *info; } // GPU workspace magmaFloat_ptr dW; if (MAGMA_SUCCESS != magma_smalloc( &dW, (1+nb)*ldda )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } /* Use hybrid blocked code. */ if (upper) { //========================================================= // Compute the LDLt factorization A = U'*D*U without pivoting. // main loop for (j=0; j<n; j += nb) { jb = min(nb, (n-j)); // copy A(j,j) back to CPU trace_gpu_start( 0, 0, "get", "get" ); //magma_queue_wait_event( stream[1], event ); magma_event_sync(event); magma_sgetmatrix_async(jb, jb, dA(j, j), ldda, A(j,j), nb, stream[1]); trace_gpu_end( 0, 0 ); // factorize the diagonal block magma_queue_sync(stream[1]);
开发者ID:liuxingrui4p,项目名称:magma-1,代码行数:67,
示例29: main//.........这里部分代码省略......... continue; } else if(!strcmp(argv[0], "-L") && argc > 1) { showtime_logtarget = argv[1]; argc -= 2; argv += 2; continue; } else if (!strcmp(argv[0], "-v") && argc > 1) { forceview = argv[1]; argc -= 2; argv += 2; } else if (!strcmp(argv[0], "--cache") && argc > 1) { mystrset(&showtime_cache_path, argv[1]); argc -= 2; argv += 2;#ifdef __APPLE__ /* ignore -psn argument, process serial number */ } else if(!strncmp(argv[0], "-psn", 4)) { argc -= 1; argv += 1; continue;#endif } else break; } unicode_init(); /* Initialize property tree */ prop_init(); init_global_info(); /* Initiailize logging */ trace_init(); /* Callout framework */ callout_init(); /* Notification framework */ notifications_init(); /* Architecture specific init */ arch_init(); htsmsg_store_init(); /* Try to create cache path */ if(showtime_cache_path != NULL && (r = makedirs(showtime_cache_path)) != 0) { TRACE(TRACE_ERROR, "cache", "Unable to create cache path %s -- %s", showtime_cache_path, strerror(r)); showtime_cache_path = NULL; } /* Initializte blob cache */ blobcache_init(); /* Try to create settings path */ if(showtime_settings_path != NULL && (r = makedirs(showtime_settings_path)) != 0) { TRACE(TRACE_ERROR, "settings", "Unable to create settings path %s -- %s", showtime_settings_path, strerror(r)); showtime_settings_path = NULL; } /* Initialize keyring */
开发者ID:holdensmagicalunicorn,项目名称:showtime,代码行数:67,
注:本文中的trace_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ trace_log函数代码示例 C++ trace_info函数代码示例 |