fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define SIZE 1000
  5.  
  6. void transpose(float *src, float *dst, const int N, const int M) {
  7. for(int n = 0; n<N*M; n++) {
  8. int i = n/N;
  9. int j = n%N;
  10. dst[n] = src[M*j + i];
  11. }
  12. }
  13.  
  14. int main(void) {
  15. float* src = new float[SIZE * SIZE];
  16. float* dst = new float[SIZE * SIZE];
  17. for (int i = 0; i < SIZE * SIZE; i ++) {
  18. src[i] = i;
  19. }
  20.  
  21. printf("Start\n");
  22. for (int i = 0; i < 320; i++) {
  23. transpose(src, dst, SIZE, SIZE);
  24. }
  25. printf("Finish\n");
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 4.96s 10960KB
stdin
Standard input is empty
stdout
Start
Finish