Projects
home:pSomng:branches:openEuler:24.03
mvapich2
_service:tar_scm:1001-update-risv-support.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:1001-update-risv-support.patch of Package mvapich2
diff --git a/src/mpid/ch3/channels/common/include/mv2_clock.h b/src/mpid/ch3/channels/common/include/mv2_clock.h index 77552c4..b7e41a3 100644 --- a/src/mpid/ch3/channels/common/include/mv2_clock.h +++ b/src/mpid/ch3/channels/common/include/mv2_clock.h @@ -93,6 +93,14 @@ static inline cycles_t get_cycles() return ret; } +#elif defined(__riscv) +// this function don't call +typedef unsigned long cycles_t; +static inline cycles_t get_cycles() +{ + return 0; +} + #else #warning get_cycles not implemented for this architecture: attempt asm/timex.h #include <asm/timex.h> diff --git a/src/mpid/ch3/channels/common/src/util/mv2_clock.c b/src/mpid/ch3/channels/common/src/util/mv2_clock.c index 4d9eb0a..74d5686 100644 --- a/src/mpid/ch3/channels/common/src/util/mv2_clock.c +++ b/src/mpid/ch3/channels/common/src/util/mv2_clock.c @@ -52,7 +52,7 @@ /* For gettimeofday */ #define _BSD_SOURCE #include <sys/time.h> - +#include <time.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> @@ -218,6 +218,21 @@ double get_cpu_mhz() #ifndef DISABLE_LOW_LEVEL_TIMERS +#if defined(__riscv) +void mv2_init_timers() +{ +} +double mv2_get_time_us() +{ + struct timespec ts; + if (clock_gettime(CLOCK_REALTIME,&ts) == -1){ + PRINT_ERROR("Error in clock_gettime."); + exit(-1); + } + long long time_us = (long long )ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + return (double)time_us; +} +#else void mv2_init_timers() { global_mhz = get_cpu_mhz(); @@ -231,6 +246,7 @@ double mv2_get_time_us() { return (get_cycles()/global_mhz); } +#endif #else
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2