本文整理汇总了C++中CLOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ CLOCK函数的具体用法?C++ CLOCK怎么用?C++ CLOCK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CLOCK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DestroyGrid
void
DestroyGrid (long my_id, time_info *local_time, long time_all)
{
box *b_scan, *tb;
particle *p;
long i;
long particle_cost;
unsigned long start = 0, finish;
if (time_all)
CLOCK(start);
b_scan = Local[my_id].Childless_Partition;
MY_NUM_PARTICLES = 0;
while (b_scan != NULL) {
tb = b_scan;
b_scan = b_scan->next;
particle_cost = tb->cost / tb->num_particles;
for (i = 0; i < tb->num_particles; i++) {
if (MY_MAX_PARTICLES <= MY_NUM_PARTICLES) {
LockedPrint("ERROR (P%d) : Too many particles in local array\n", my_id);
exit(-1);
}
p = tb->particles[i];
p->cost = particle_cost;
MY_PARTICLES[MY_NUM_PARTICLES++] = p;
}
}
if (my_id == 0)
Grid = NULL;
if (time_all) {
CLOCK(finish);
local_time[MY_TIME_STEP].other_time += finish - start;
}
}
开发者ID:CoryXie,项目名称:Graphite,代码行数:34,代码来源:construct_grid.C
示例2: display_other_heuristics
void display_other_heuristics(tm_topology_t *topology,int N,double **comm,double **arch){
CLOCK_T time1,time0;
double duration;
int *sol;
sol=(int*)malloc(sizeof(int)*N);
map_Packed(topology,N,sol);
printf("Packed: ");
print_sol(N,sol,comm,arch);
map_RR(N,sol);
printf("RR: ");
print_sol(N,sol,comm,arch);
CLOCK(time0);
map_MPIPP(topology,1,N,sol,comm,arch);
CLOCK(time1);
duration=CLOCK_DIFF(time1,time0);
printf("MPIPP-1-D:%f\n",duration);
printf("MPIPP-1: ");
print_sol(N,sol,comm,arch);
CLOCK(time0);
map_MPIPP(topology,5,N,sol,comm,arch);
CLOCK(time1);
duration=CLOCK_DIFF(time1,time0);
printf("MPIPP-5-D:%f\n",duration);
printf("MPIPP-5: ");
print_sol(N,sol,comm,arch);
free(sol);
}
开发者ID:davidheryanto,项目名称:sc14,代码行数:35,代码来源:tm_mapping.c
示例3: firmware
void firmware() {
display_init();
gfx_init_ctxt(&gfx_ctxt, display_init_framebuffer(), 720, 1280, 768);
gfx_clear_color(&gfx_ctxt, 0xFF000000);
gfx_con_init(&gfx_con, &gfx_ctxt);
gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0);
while (!sdMount()) {
error("Failed to init SD card!\n");
print("Press POWER to power off, any other key to retry\n");
if (btn_wait() & BTN_POWER)
i2c_send_byte(I2C_5, 0x3C, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_PWR_OFF);
btn_wait();
}
if(PMC(APBDEV_PMC_SCRATCH49) != 69 && fopen("/ReiNX.bin", "rb")) {
fread((void*)PAYLOAD_ADDR, fsize(), 1);
fclose();
sdUnmount();
display_end();
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= 0x400; // Enable AHUB clock.
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= 0x40; // Enable APE clock.
PMC(APBDEV_PMC_SCRATCH49) = 69;
((void (*)())PAYLOAD_ADDR)();
}
SYSREG(AHB_AHB_SPARE_REG) = (volatile vu32)0xFFFFFF9F;
PMC(APBDEV_PMC_SCRATCH49) = 0;
print("Welcome to ReiNX %s!\n", VERSION);
loadFirm();
drawSplash();
launch();
}
开发者ID:masterspike52,项目名称:ReiNX,代码行数:33,代码来源:firmware.c
示例4: PalEvidence
void PalEvidence(char* tpal,char* pal)
{
const int SPEED = 4;
int log = 1,i;
int t;
while(log) {
t = CLOCK();
while(CLOCK() < t + 1);
log = 0;
for(i = 0; i < 256; i++) {
tpal[3*i + 0] += SPEED;
tpal[3*i + 1] += SPEED;
tpal[3*i + 2] += SPEED;
if(tpal[3*i + 0] >= pal[3*i + 0]) tpal[3*i + 0] = pal[3*i + 0];
else log = 1;
if(tpal[3*i + 1] >= pal[3*i + 1]) tpal[3*i + 1] = pal[3*i + 1];
else log = 1;
if(tpal[3*i + 2] >= pal[3*i + 2]) tpal[3*i + 2] = pal[3*i + 2];
else log = 1;
}
XGR_SetPal(tpal,0,255);
XGR_Flush(0,0,XGR_MAXX,XGR_MAXY);
xtClearMessageQueue();
}
}
开发者ID:KranX,项目名称:Vangers,代码行数:25,代码来源:palette.cpp
示例5: main
int main(int argc, char **argv) {
int n,i,j;
double **a;
double *b, count=1.0;
unsigned int t1,t2;
MAIN_INITENV
if (argc!=2) {
printf("Usage: bksb <size>\nAborting...\n");
exit(0);
}
n = atoi(argv[1]);
a = (double**)G_MALLOC(n*sizeof(double*));
for(i = 0; i < n; i++) {
a[i] = (double*)G_MALLOC(n*sizeof(double));
for(j = i;j < n;j++) {
a[i][j] = count;
count++;
}
}
b = (double*)G_MALLOC(n*sizeof(double));
for(i = 0; i < n; i++) {
b[i] = count;
count++;
}
CLOCK(t1)
bksb(a,b,n);
CLOCK(t2)
printf("Elapsed: %u microseconds\n",t2-t1);
for(i = 0; i < n; i++) printf("%lf ", b[i]);
printf("\n");
MAIN_END
return 0;
}
开发者ID:ShinThirty,项目名称:ece5750,代码行数:33,代码来源:bksb.C
示例6: clock_disable
void clock_disable(const clock_t *clk)
{
//Put clock into reset.
CLOCK(clk->reset) = (CLOCK(clk->reset) & ~(1 << clk->index)) | (1 << clk->index);
//Disable.
CLOCK(clk->enable) &= ~(1 << clk->index);
}
开发者ID:NecroGankedd,项目名称:hekate,代码行数:7,代码来源:clock.c
示例7: mc_enable_ahb_redirect
void mc_enable_ahb_redirect()
{
CLOCK(0x3A4) = CLOCK(0x3A4) & 0xFFF7FFFF | 0x80000;
//MC(MC_IRAM_REG_CTRL) &= 0xFFFFFFFE;
MC(MC_IRAM_BOM) = 0x40000000;
MC(MC_IRAM_TOM) = 0x4003F000;
}
开发者ID:baka-koroshiya,项目名称:Atmosphere,代码行数:7,代码来源:hwinit.c
示例8: ConstructGrid
void
ConstructGrid (long my_id, time_info *local_time, long time_all)
{
unsigned long init = 0, start = 0, finish;
if (time_all)
CLOCK(init);
DetermineGridSize(my_id); /* Finds the four corners of the grid. */
FreeBoxes(my_id);
InitPartition(my_id);
if (time_all)
CLOCK(start);
if (MY_NUM_PARTICLES > 0) {
ConstructLocalGrid(my_id); /* Each processor constructs their own tree
based on only their particles */
MergeLocalGrid(my_id); /* The processors combine their trees into one
global tree. This step contains
communication between processors. */
}
BARRIER(G_Memory->synch, Number_Of_Processors);
CleanupGrid(my_id);
if (time_all)
CLOCK(finish);
if (time_all) {
local_time[MY_TIME_STEP].other_time = start - init;
local_time[MY_TIME_STEP].construct_time = finish - start;
}
}
开发者ID:CoryXie,项目名称:Graphite,代码行数:29,代码来源:construct_grid.C
示例9: main
int main (int argc, string argv[])
#endif
{
#ifndef SIM_SOCLIB
long c;
while ((c = getopt(argc, argv, "h")) != -1) {
switch(c) {
case 'h':
Help();
exit(-1);
break;
default:
fprintf(stderr, "Only valid option is \"-h\".\n");
exit(-1);
break;
}
}
#endif
Global = NULL;
initparam(defv);
startrun();
initoutput();
tab_init();
Global->tracktime = 0;
Global->partitiontime = 0;
Global->treebuildtime = 0;
Global->forcecalctime = 0;
Global->current_id = 0;
CLOCK(Global->computestart);
printf("COMPUTESTART = %12lu\n",Global->computestart);
CREATE(SlaveStart, NPROC);
WAIT_FOR_END(NPROC);
CLOCK(Global->computeend);
printf("COMPUTEEND = %12lu\n",Global->computeend);
printf("COMPUTETIME = %12lu\n",Global->computeend - Global->computestart);
printf("TRACKTIME = %12lu\n",Global->tracktime);
printf("PARTITIONTIME = %12lu\t%5.2f\n",Global->partitiontime,
((float)Global->partitiontime)/Global->tracktime);
printf("TREEBUILDTIME = %12lu\t%5.2f\n",Global->treebuildtime,
((float)Global->treebuildtime)/Global->tracktime);
printf("FORCECALCTIME = %12lu\t%5.2f\n",Global->forcecalctime,
((float)Global->forcecalctime)/Global->tracktime);
printf("RESTTIME = %12lu\t%5.2f\n",
Global->tracktime - Global->partitiontime -
Global->treebuildtime - Global->forcecalctime,
((float)(Global->tracktime-Global->partitiontime-
Global->treebuildtime-Global->forcecalctime))/
Global->tracktime);
MAIN_END;
}
开发者ID:marcoscunha,项目名称:reverse,代码行数:59,代码来源:code.C
示例10: main
int main(int argc,char **argv) {
int i,j,p,n;
double **a,*b, count=1.0;
unsigned int t1,t2;
MAIN_INITENV
if (argc!=3) {
printf("Usage: pbksb P N\nAborting...\n");
exit(0);
}
gm = (GM*)G_MALLOC(sizeof(GM));
p = gm->p = atoi(argv[1]);
gm->n = atoi(argv[2]);
assert(p > 0);
assert(p <= 8);
n = gm->n;
a = gm->a = (double**)G_MALLOC(n*sizeof(double*));
for(i = 0; i < n; i++) {
a[i] = (double*)G_MALLOC(n*sizeof(double));
for(j = i;j < n;j++){
a[i][j] = count;
count++;
}
}
//-----------------------------------------------
// Create 1D array a_prime and map a to a_prime
//-----------------------------------------------
gm->a_prime = (double*)G_MALLOC((n+1)*n/2*sizeof(double))
mapping();
b = gm->b = (double*)G_MALLOC(n*sizeof(double));
for(i = 0; i < n; i++) {
b[i] = count;
count++;
}
gm->pse = (char*)G_MALLOC(n*sizeof(char));
for(i = 0; i < n; i++)
CLEARPAUSE(gm->pse[i])
for(i = 0; i < p-1; i++)
CREATE(pbksb)
CLOCK(t1)
pbksb();
WAIT_FOR_END(p-1)
CLOCK(t2)
printf("Elapsed: %u us\n",t2-t1);
for(i = 0; i < n; i++) printf("%lf ", gm->b[i]);
printf("\n");
for(i = 0; i < n; i++)
G_FREE(a[i],n*sizeof(double))
G_FREE(a,n*sizeof(double*))
G_FREE(b,n*sizeof(double))
G_FREE(gm->a_prime, (n+1)*n/2*sizeof(double))
MAIN_END
return 0;
}
开发者ID:ShinThirty,项目名称:ece5750,代码行数:55,代码来源:pbksb.C
示例11: UNCLOCK
void CServer::DoPulse()
{
UNCLOCK( "Top", "Other" );
if ( m_pGame )
{
CLOCK( "Top", "Game->DoPulse" );
m_pGame->DoPulse ();
UNCLOCK( "Top", "Game->DoPulse" );
}
CLOCK( "Top", "Other" );
}
开发者ID:EagleShen,项目名称:MTA,代码行数:11,代码来源:CServer.cpp
示例12: PartitionGrid
void
PartitionGrid (long my_id, time_info *local_time, long time_all)
{
unsigned long start = 0, finish;
if (time_all)
CLOCK(start);
if (Partition_Flag == COST_ZONES)
CostZones(my_id);
if (time_all) {
CLOCK(finish);
local_time[MY_TIME_STEP].partition_time = finish - start;
}
}
开发者ID:gspeiliu,项目名称:Benchmarks,代码行数:14,代码来源:fmm.C
示例13: _clock_sdmmc_clear_reset
static void _clock_sdmmc_clear_reset(u32 id)
{
switch (id)
{
case SDMMC_1:
CLOCK(CLK_RST_CONTROLLER_RST_DEV_L_CLR) = L_CLR_SDMMC1_RST;
case SDMMC_2:
CLOCK(CLK_RST_CONTROLLER_RST_DEV_L_CLR) = L_CLR_SDMMC2_RST;
case SDMMC_3:
CLOCK(CLK_RST_CONTROLLER_RST_DEV_U_CLR) = U_CLR_SDMMC3_RST;
case SDMMC_4:
CLOCK(CLK_RST_CONTROLLER_RST_DEV_L_CLR) = L_CLR_SDMMC4_RST;
}
}
开发者ID:NecroGankedd,项目名称:hekate,代码行数:14,代码来源:clock.c
示例14: _clock_sdmmc_clear_enable
static void _clock_sdmmc_clear_enable(u32 id)
{
switch (id)
{
case SDMMC_1:
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_L_CLR) = L_CLR_CLK_ENB_SDMMC1;
case SDMMC_2:
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_L_CLR) = L_CLR_CLK_ENB_SDMMC2;
case SDMMC_3:
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_U_CLR) = U_CLR_CLK_ENB_SDMMC3;
case SDMMC_4:
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_L_CLR) = L_CLR_CLK_ENB_SDMMC4;
}
}
开发者ID:NecroGankedd,项目名称:hekate,代码行数:14,代码来源:clock.c
示例15: _clock_sdmmc_is_reset
static int _clock_sdmmc_is_reset(u32 id)
{
switch (id)
{
case SDMMC_1:
return CLOCK(CLK_RST_CONTROLLER_RST_DEVICES_L) & L_SWR_SDMMC1_RST;
case SDMMC_2:
return CLOCK(CLK_RST_CONTROLLER_RST_DEVICES_L) & L_SWR_SDMMC2_RST;
case SDMMC_3:
return CLOCK(CLK_RST_CONTROLLER_RST_DEVICES_U) & U_SWR_SDMMC3_RST;
case SDMMC_4:
return CLOCK(CLK_RST_CONTROLLER_RST_DEVICES_L) & L_SWR_SDMMC4_RST;
}
return 0;
}
开发者ID:NecroGankedd,项目名称:hekate,代码行数:15,代码来源:clock.c
示例16: _clock_sdmmc_is_enabled
static int _clock_sdmmc_is_enabled(u32 id)
{
switch (id)
{
case SDMMC_1:
return CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_L) & L_CLK_ENB_SDMMC1;
case SDMMC_2:
return CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_L) & L_CLK_ENB_SDMMC2;
case SDMMC_3:
return CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_U) & U_CLK_ENB_SDMMC3;
case SDMMC_4:
return CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_L) & L_CLK_ENB_SDMMC4;
}
return 0;
}
开发者ID:NecroGankedd,项目名称:hekate,代码行数:15,代码来源:clock.c
示例17: mc_enable
void mc_enable()
{
CLOCK(CLK_RST_CONTROLLER_CLK_SOURCE_EMC) = CLOCK(CLK_RST_CONTROLLER_CLK_SOURCE_EMC) & 0x1FFFFFFF | 0x40000000;
//Enable MIPI CAL clock.
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_H_SET) = CLOCK(CLK_RST_CONTROLLER_CLK_ENB_H_SET) & 0xFDFFFFFF | 0x2000000;
//Enable MC clock.
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_H_SET) = CLOCK(CLK_RST_CONTROLLER_CLK_ENB_H_SET) & 0xFFFFFFFE | 1;
//Enable EMC DLL clock.
CLOCK(CLK_RST_CONTROLLER_CLK_ENB_X_SET) = CLOCK(CLK_RST_CONTROLLER_CLK_ENB_X_SET) & 0xFFFFBFFF | 0x4000;
CLOCK(CLK_RST_CONTROLLER_RST_DEV_H_SET) = 0x2000001; //Clear EMC and MC reset.
sleep(5);
}
开发者ID:baka-koroshiya,项目名称:Atmosphere,代码行数:12,代码来源:hwinit.c
示例18: INPUT_MERGER_ANY_HIGH
void acorn_vib_device::device_add_mconfig(machine_config &config)
{
INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set(FUNC(acorn_vib_device::irq_w));
VIA6522(config, m_via6522, XTAL(1'000'000));
m_via6522->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
m_via6522->ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
m_via6522->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>));
CENTRONICS(config, m_centronics, centronics_devices, "printer");
m_centronics->ack_handler().set(m_via6522, FUNC(via6522_device::write_ca1));
m_centronics->busy_handler().set(m_via6522, FUNC(via6522_device::write_pa7));
output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out"));
m_centronics->set_output_latch(cent_data_out);
I8255(config, m_ppi8255, 0);
ACIA6850(config, m_acia, 0);
m_acia->txd_handler().set(m_rs232, FUNC(rs232_port_device::write_txd));
m_acia->rts_handler().set(m_rs232, FUNC(rs232_port_device::write_rts));
m_acia->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>));
RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
m_rs232->rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
m_rs232->cts_handler().set(m_acia, FUNC(acia6850_device::write_cts));
m_rs232->dcd_handler().set(m_acia, FUNC(acia6850_device::write_dcd));
CLOCK(config, m_acia_clock, 1.8432_MHz_XTAL);
m_acia_clock->signal_handler().set(FUNC(acorn_vib_device::write_acia_clock));
}
开发者ID:PugsyMAME,项目名称:mame,代码行数:30,代码来源:vib.cpp
示例19: Z80
void selz80_state::selz80(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(4'000'000)); // it's actually a 5MHz XTAL with a NEC uPD780C-1 cpu
m_maincpu->set_addrmap(AS_PROGRAM, &selz80_state::selz80_mem);
m_maincpu->set_addrmap(AS_IO, &selz80_state::selz80_io);
MCFG_MACHINE_RESET_OVERRIDE(selz80_state, selz80 )
/* video hardware */
config.set_default_layout(layout_selz80);
/* Devices */
CLOCK(config, m_clock, 153600);
m_clock->signal_handler().set("uart", FUNC(i8251_device::write_txc));
m_clock->signal_handler().append("uart", FUNC(i8251_device::write_rxc));
i8251_device &uart(I8251(config, "uart", 0));
uart.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
uart.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr));
uart.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
rs232.rxd_handler().set("uart", FUNC(i8251_device::write_rxd));
rs232.dsr_handler().set("uart", FUNC(i8251_device::write_dsr));
rs232.cts_handler().set("uart", FUNC(i8251_device::write_cts));
i8279_device &kbdc(I8279(config, "i8279", 5000000 / 2)); // based on divider
kbdc.out_sl_callback().set(FUNC(selz80_state::scanlines_w)); // scan SL lines
kbdc.out_disp_callback().set(FUNC(selz80_state::digit_w)); // display A&B
kbdc.in_rl_callback().set(FUNC(selz80_state::kbd_r)); // kbd RL lines
kbdc.in_shift_callback().set_constant(1); // Shift key
kbdc.in_ctrl_callback().set_constant(1);
}
开发者ID:SailorSat,项目名称:cabmame,代码行数:33,代码来源:selz80.cpp
示例20: Z80
void idsa_state::idsa(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(8'000'000) / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &idsa_state::maincpu_map);
m_maincpu->set_addrmap(AS_IO, &idsa_state::maincpu_io_map);
clock_device &irqclock(CLOCK(config, "irqclock", XTAL(8'000'000) / 4));
irqclock.signal_handler().set(FUNC(idsa_state::clock_w));
/* video hardware */
//config.set_default_layout()
/* sound hardware */
genpin_audio(config);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
SP0256(config, m_speech, 3120000); // unknown variant
m_speech->add_route(ALL_OUTPUTS, "lspeaker", 1.5);
ay8910_device &aysnd1(AY8910(config, "aysnd1", 2000000)); // 2Mhz according to pinmame, schematic omits the clock line
aysnd1.port_a_write_callback().set(FUNC(idsa_state::ay1_a_w));
aysnd1.port_b_write_callback().set(FUNC(idsa_state::ay1_b_w));
aysnd1.add_route(ALL_OUTPUTS, "lspeaker", 0.75);
ay8910_device &aysnd2(AY8910(config, "aysnd2", 2000000));
aysnd2.port_a_write_callback().set(FUNC(idsa_state::ay2_a_w));
aysnd2.port_b_write_callback().set(FUNC(idsa_state::ay2_b_w));
aysnd2.add_route(ALL_OUTPUTS, "rspeaker", 0.75);
}
开发者ID:PugsyMAME,项目名称:mame,代码行数:30,代码来源:idsa.cpp
注:本文中的CLOCK函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论