Skip to content

Commit

Permalink
On z/OS import time.h in addition to sys/time.h (onnx#2788) (onnx#2790)
Browse files Browse the repository at this point in the history
* On z/OS import time.h in addition to sys/time.h

# Description
* On z/OS `CLOCKS_PER_SEC` is in time.h and `timeval` is in sys/time.sh so we need both imported.



---------

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
  • Loading branch information
cjvolzka authored Apr 9, 2024
1 parent 35a61d3 commit 0833dac
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/Accelerators/NNPA/Runtime/zDNNExtension/Elementwise.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
//
//===----------------------------------------------------------------------===//

// Include pthreads (need special treatment on z/OS).
// z/OS specific includes
#ifdef __MVS__
// needed for pthread on z/OS
#define _OPEN_THREADS
// z/OS needs <time.h> in addition to <sys/time.h>
#include <time.h>
#endif
#include <pthread.h>

#include <assert.h>
#include <math.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
Expand Down
7 changes: 5 additions & 2 deletions src/Accelerators/NNPA/Runtime/zDNNExtension/MatMul.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
//
//===----------------------------------------------------------------------===//

// Include pthreads (need special treatment on z/OS).
// z/OS specific includes
#ifdef __MVS__
// special treatment for pthreads on z/OS.
#define _OPEN_THREADS
#define _OPEN_SYS_EXT
#include <sys/ps.h>
// z/OS needs <time.h> in addition to <sys/time.h>
#include <time.h>
#endif
#include <pthread.h>

#include <assert.h>
#include <math.h>
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
7 changes: 5 additions & 2 deletions src/Accelerators/NNPA/Runtime/zDNNExtension/Softmax.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
//
//===----------------------------------------------------------------------===//

// Include pthreads (need special treatment on z/OS).
// z/OS specific includes
#ifdef __MVS__
// needed for pthread on z/OS
#define _OPEN_THREADS
// z/OS needs <time.h> in addition to <sys/time.h>
#include <time.h>
#endif
#include <pthread.h>

#include <assert.h>
#include <math.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
Expand Down
6 changes: 6 additions & 0 deletions src/Accelerators/NNPA/Runtime/zDNNExtension/zDNNExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#ifndef ONNX_MLIR_ZDNNEXTENSION_H
#define ONNX_MLIR_ZDNNEXTENSION_H

// z/OS specific includes
#ifdef __MVS__
// z/OS needs <time.h> in addition to <sys/time.h>
#include <time.h>
#endif

#include <stdlib.h>
#include <sys/time.h>

Expand Down

0 comments on commit 0833dac

Please sign in to comment.