copy.rb 17.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
stdin1, stdout0 = IO.pipe
stdin2, stdout1 = IO.pipe

pid1 = Process.fork {
  stdout0.close
  stdin2.close
  require 'cast'

  parser = C::Parser::new
  parser.type_names << '__builtin_va_list'
  cpp = C::Preprocessor::new
  cpp.macros['__attribute__(a)'] = ''
  cpp.macros['__restrict'] = 'restrict'
  cpp.macros['__extension__'] = ''
  cpp.macros['__asm__(a)'] = ''
  cpp.include_path << './'



  preprocessed_sources = cpp.preprocess(<<EOF).gsub(/^#.*?$/, '')
#include <stddef.h>
#include <stdint.h>
#include <aml-layout.h>
Brice Videau's avatar
Brice Videau committed
24
#include <aml-layout-dense.h>
25 26 27 28 29 30 31 32 33
#include <string.h>
#include <alloca.h>
EOF

  parser.parse(preprocessed_sources)

  ast = parser.parse(stdin1.read)
  stdin1.close

34 35 36 37 38 39
  ast.postorder { |n|
    n.stmt = n.stmt.stmts.first if n.For? && n.stmt.Block? && n.stmt.stmts.size == 1
    n.then = n.then.stmts.first if n.If? && n.then.Block? && n.then.stmts.size == 1
    n.else = n.else.stmts.first if n.If? && n.else && n.else.Block? && n.else.stmts.size == 1
  }

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
  stdout1.puts <<EOF
#include <aml.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <alloca.h>

EOF
  stdout1.puts ast
  stdout1.close
}

pid2 = Process.fork {
  stdin1.close
  stdout0.close
  stdout1.close
  require 'open3'
  Open3.popen3('indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1') do |i, o, t|
    i.write stdin2.read
    stdin2.close
    i.close
    puts o.read
  end
}

stdin1.close
stdout1.close
stdin2.close

require 'BOAST'
include BOAST

set_array_start(0)
set_lang(C)
set_default_int_size(nil)
set_output(stdout0)

register_funccall( :alloca )
register_funccall( :memcpy )
register_funccall( :assert )
register_funccall( :sizeof )

def name_prefix
  "aml_copy_"
end

def name(suffix = nil, stride: false, shuffle: false)
  name = name_prefix
  name << "sh" if shuffle
  name << "nd"
  name << "str" if stride
  name << "_#{suffix}" if suffix
  name
end

def transpose_name(reverse: false, stride: false, cumulative: false)
  name = name_prefix
  name << "r" if reverse
  name << "tnd"
  name << "str" if stride
  name << "_c" if cumulative
  name
end

def aml_compute_cumulative_pitch
  d = Sizet :d
  cumul_dst_pitch = Sizet :cumul_dst_pitch, dim: Dim(d), dir: :out
  cumul_src_pitch = Sizet :cumul_src_pitch, dim: Dim(d), dir: :out
  dst_pitch = Sizet :dst_pitch, dim: Dim(d), dir: :in
  src_pitch = Sizet :src_pitch, dim: Dim(d), dir: :in
  elem_size = Sizet :elem_size
  i = Sizet :i
  p = Procedure( :aml_compute_cumulative_pitch,
                 [ d,
                   cumul_dst_pitch, cumul_src_pitch,
                   dst_pitch, src_pitch,
                   elem_size ],
                 local: true,
                 inline: true ) {
    pr cumul_dst_pitch[0] === elem_size;
    pr cumul_src_pitch[0] === elem_size;
    
    pr For(i, 0, d - 1, operator: '<', declit: true) {
      pr cumul_dst_pitch[i + 1] === dst_pitch[i] * cumul_dst_pitch[i]
      pr cumul_src_pitch[i + 1] === src_pitch[i] * cumul_src_pitch[i]
    } 
  }
end

def aml_copy_nd_helper(stride: false, shuffle: false)
  d = Sizet :d
  target_dims = Sizet :target_dims, dim: Dim(), dir: :in
  dst = Pointer :dst, dir: :out
  cumul_dst_pitch = Sizet :cumul_dst_pitch, dim: Dim(), dir: :in
  dst_stride = Sizet :dst_stride, dim: Dim(), dir: :in
  src = Pointer :src, dir: :in
  cumul_src_pitch = Sizet :cumul_src_pitch, dim: Dim(), dir: :in
  src_stride = Sizet :src_stride, dim: Dim(), dir: :in
  elem_number = Sizet :elem_number, dim: Dim(), dir: :in
  elem_size = Sizet :elem_size
  i = Sizet :i

  args = []
  args += [ d ]
  args += [ target_dims ] if shuffle
  args += [ dst, cumul_dst_pitch ]
  args += [ dst_stride ] if stride
  args += [ src, cumul_src_pitch ]
  args += [ src_stride ] if stride
149
  args += [ elem_number, elem_size ]
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217

  effective_dst_pitch = lambda { |d| cumul_dst_pitch[d] }
  effective_src_pitch = lambda { |d| cumul_src_pitch[d] }
  if stride
    tmp_dst = effective_dst_pitch
    effective_dst_pitch = lambda { |d| dst_stride[d] * tmp_dst[d] }
    tmp_src = effective_src_pitch
    effective_src_pitch = lambda { |d| src_stride[d] * tmp_src[d] }
  end

  src_index = lambda { |d| d }
  dst_index = lambda { |d| d }
  elem_index = lambda { |d| d }
  if shuffle
    elem_index = lambda { |d| target_dims[d] }
    src_index = lambda { |d| target_dims[d] }
  end

  name = name(:helper, stride: stride, shuffle: shuffle)

  p = Procedure( name,
                 args,
                 local: true,
                 inline: true ) {
    pr If( d == 1 => lambda {
      pr If( And(effective_dst_pitch[dst_index[0]] == elem_size,
                 effective_src_pitch[src_index[0]] == elem_size) => lambda {
        pr memcpy(dst, src, elem_number[elem_index[0]] * elem_size) 
      }, else: lambda {
        pr For( i, 0, elem_number[elem_index[0]], operator: '<', declit: true ) {
          pr memcpy( (dst.cast(Intptrt) + i * effective_dst_pitch[dst_index[0]]).cast(dst),
                     (src.cast(Intptrt) + i * effective_src_pitch[src_index[0]]).cast(src),
                     elem_size)
        }
      })
    }, else: lambda {
      pr For( i, 0, elem_number[elem_index[d - 1]], operator: '<', declit: true ) {
        args[0] = d - 1
        pr p.call(*args)
        pr dst === (dst.cast(Intptrt) + effective_dst_pitch[dst_index[d - 1]]).cast(dst)
        pr src === (src.cast(Intptrt) + effective_src_pitch[src_index[d - 1]]).cast(src)
      }
    })
 
  }
end

def aml_copy_nd_c(stride: false, shuffle: false)
  d = Sizet :d
  target_dims = Sizet :target_dims, dim: Dim(), dir: :in
  dst = Pointer :dst, dir: :out
  cumul_dst_pitch = Sizet :cumul_dst_pitch, dim: Dim(d), dir: :in
  dst_stride = Sizet :dst_stride, dim: Dim(d), dir: :in
  src = Pointer :src, dir: :in
  cumul_src_pitch = Sizet :cumul_src_pitch, dim: Dim(d), dir: :in
  src_stride = Sizet :src_stride, dim: Dim(d), dir: :in
  elem_number = Sizet :elem_number, dim: Dim(d), dir: :in
  elem_size = Sizet :elem_size
  i = Sizet :i
  present_dims = Sizet :present_dims

  args = []
  args += [ d ]
  args += [ target_dims ] if shuffle
  args += [ dst, cumul_dst_pitch ]
  args += [ dst_stride ] if stride
  args += [ src, cumul_src_pitch]
  args += [ src_stride ] if stride
218
  args += [ elem_number, elem_size]
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280

  effective_dst_pitch = lambda { |d| cumul_dst_pitch[d] }
  effective_src_pitch = lambda { |d| cumul_src_pitch[d] }
  if stride
    tmp_dst = effective_dst_pitch
    effective_dst_pitch = lambda { |d| dst_stride[d] * tmp_dst[d] }
    tmp_src = effective_src_pitch
    effective_src_pitch = lambda { |d| src_stride[d] * tmp_src[d] }
  end

  elem_index = lambda { |d| d }
  if shuffle
    elem_index = lambda { |d| target_dims[d] }
  end

  name = name(:c, stride: stride, shuffle: shuffle)

  p = Procedure( name,
                 args,
                 return_type: Int ) {
    pr assert(d > 0)
    if shuffle
      decl present_dims
      pr present_dims === 0
      pr For(i, 0, d, operator: '<', declit: true ) {
        pr assert(target_dims[i] < d)
        get_output.puts "#{present_dims} |= 1 << #{target_dims[i]};"
      }
      pr For(i, 0, d, operator: '<', declit: true ) {
        pr assert("#{present_dims} & (1 << #{i})")
      }
    end
    pr For(i, 0, d - 1, operator: '<', declit: true ) {
      pr assert(cumul_dst_pitch[i + 1] >= effective_dst_pitch[i] * elem_number[elem_index[i]]);
      pr assert(cumul_src_pitch[i + 1] >= effective_src_pitch[i] * elem_number[i]);
    }
    pr aml_copy_nd_helper(stride: stride, shuffle: shuffle).call( *args )
    pr Return(0)
  }
end

def aml_copy_nd(stride: false, shuffle: false)
  d = Sizet :d
  target_dims = Sizet :target_dims, dim: Dim(d), dir: :in
  dst = Pointer :dst, dir: :out
  dst_pitch = Sizet :dst_pitch, dim: Dim(d), dir: :in
  dst_stride = Sizet :dst_stride, dim: Dim(d), dir: :in
  src = Pointer :src, dir: :in
  src_pitch = Sizet :src_pitch, dim: Dim(d), dir: :in
  src_stride = Sizet :src_stride, dim: Dim(d), dir: :in
  elem_number = Sizet :elem_number, dim: Dim(d), dir: :in
  elem_size = Sizet :elem_size
  cumul_dst_pitch = Pointer :cumul_dst_pitch, type: Sizet
  cumul_src_pitch = Pointer :cumul_src_pitch, type: Sizet

  args = []
  args += [ d ]
  args += [ target_dims ] if shuffle
  args += [ dst, dst_pitch ]
  args += [ dst_stride ] if stride
  args += [ src, src_pitch]
  args += [ src_stride ] if stride
281
  args += [ elem_number, elem_size]
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327

  name = name(stride: stride, shuffle: shuffle)

  p = Procedure( name,
                 args,
                 return_type: Int ) {
    pr assert(d > 0);
    decl cumul_dst_pitch, cumul_src_pitch
    pr cumul_dst_pitch === alloca(d * sizeof("size_t")).cast(cumul_dst_pitch)
    pr cumul_src_pitch === alloca(d * sizeof("size_t")).cast(cumul_src_pitch)
    pr $aml_compute_cumulative_pitch.call(d, cumul_dst_pitch, cumul_src_pitch,
                                          dst_pitch, src_pitch, elem_size);
    args = []
    args += [ d ]
    args += [ target_dims ] if shuffle
    args += [ dst, cumul_dst_pitch ]
    args += [ dst_stride ] if stride
    args += [ src, cumul_src_pitch]
    args += [ src_stride ] if stride
    args +=  [ elem_number, elem_size]

    pr aml_copy_nd_c(stride: stride, shuffle: shuffle).call( *args )
    pr Return(0)
  }
end

def aml_copy_tnd(reverse: false, stride: false, cumulative: false)
  d = Sizet :d
  dst = Pointer :dst, dir: :out
  dst_pitch = Sizet :dst_pitch, dim: Dim(d), dir: :in
  cumul_dst_pitch = Sizet :cumul_dst_pitch, dim: Dim(d), dir: :in
  dst_stride = Sizet :dst_stride, dim: Dim(d), dir: :in
  src = Pointer :src, dir: :in
  src_pitch = Sizet :src_pitch, dim: Dim(d), dir: :in
  src_stride = Sizet :src_stride, dim: Dim(d), dir: :in
  cumul_src_pitch = Sizet :cumul_src_pitch, dim: Dim(d), dir: :in
  elem_number = Sizet :elem_number, dim: Dim(d), dir: :in
  elem_size = Sizet :elem_size

  args = []
  args += [ d, dst ]
  args += cumulative ? [ cumul_dst_pitch ] : [ dst_pitch ] 
  args += [ dst_stride ] if stride
  args += [ src ]
  args += cumulative ? [ cumul_src_pitch ] : [ src_pitch ]
  args += [ src_stride ] if stride
328
  args += [ elem_number, elem_size]
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363

  target_dims = Sizet :target_dims, dim: Dim(d)
  i = Sizet :i

  name = transpose_name(reverse: reverse, stride: stride, cumulative: cumulative)

  p = Procedure( name,
                 args,
                 return_type: Int ) {
    pr assert(d > 0);
    decl target_dims
    pr target_dims === alloca(d * sizeof("size_t")).cast(target_dims)
    if reverse
      pr target_dims[0] === d - 1
      pr For(i, 1, d, operator: '<', declit: true) {
        pr target_dims[i] === i - 1
      }
    else
      pr target_dims[d - 1] === 0
      pr For(i, 0, d - 1, operator: '<', declit: true) {
        pr target_dims[i] === i + 1
      }
    end

    args.insert(1, target_dims)

    if cumulative
      pr aml_copy_nd_c(stride: stride, shuffle: true).call(*args)
    else
      pr aml_copy_nd(stride: stride, shuffle: true).call(*args)
    end
    pr Return(0)
  }
end

Brice Videau's avatar
Brice Videau committed
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
def aml_copy_layout_generic_helper(shuffle: false)
  d = Sizet :d
  dst = Pointer :dst, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :inout
  src = Pointer :src, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :in
  elem_number = Sizet :elem_number, dim: Dim(), dir: :in
  elem_size = Sizet :elem_size
  coords = Sizet :coords, dim: Dim(), dir: :inout
  coords_out = Sizet :coords_out, dim: Dim(), dir: :inout
  target_dims = Sizet :target_dims, dim: Dim(), dir: :in

  i = Sizet :i

  name = name_prefix + "layout_"
  name << "transform_" if shuffle
  name << "generic_helper"

  args = [d, dst, src, elem_number, elem_size, coords]
  args << coords_out << target_dims if shuffle

  src_index = lambda { |d| d }
  dst_index = lambda { |d| d }
  elem_index = lambda { |d| d }
  if shuffle
    elem_index = lambda { |d| target_dims[d] }
    src_index = lambda { |d| target_dims[d] }
  end

  coord_src = coords
  coord_dst = coords
  if shuffle
    coord_dst = coords_out
  end

  p = Procedure( name, args, local: true, inline: true ) {
    pr If( d == 1 => lambda {
      pr For( i, 0, elem_number[elem_index[0]], operator: '<', declit: true ) {
        pr coord_dst[dst_index[0]] === i
        pr coord_src[src_index[0]] === i
402
        pr memcpy( FuncCall(:aml_layout_aderef_column, dst, coord_dst), FuncCall(:aml_layout_aderef_column, src, coord_src), elem_size )
Brice Videau's avatar
Brice Videau committed
403 404 405 406 407 408 409 410 411 412 413 414
      }
    }, else: lambda {
      pr For( i, 0, elem_number[elem_index[d - 1]], operator: '<', declit: true ) {
        args[0] = d - 1
        pr coord_dst[dst_index[d - 1]] === i
        pr coord_src[src_index[d - 1]] === i
        pr p.call(*args)
      }
    })
  }
end

415
def aml_copy_layout(native: true, shuffle: false)
416 417 418 419
  dst = Pointer :dst, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :inout
  src = Pointer :src, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :in
  target_dims = Sizet :target_dims, dim: Dim(), dir: :in

Brice Videau's avatar
Brice Videau committed
420 421
  ddst = Pointer :ddst, type: CStruct::new(type_name: :aml_layout_data_native, members: {})
  dsrc = Pointer :dsrc, type: CStruct::new(type_name: :aml_layout_data_native, members: {})
422 423 424 425 426 427 428 429 430 431 432 433
  d = Sizet :d
  elem_size = Sizet :elem_size
  i = Sizet :i

  src_index = lambda { |d| d }
  dst_index = lambda { |d| d }
  if shuffle
    src_index = lambda { |d| target_dims[d] }
  end

  name = name_prefix + "layout_"
  name << "transform_" if shuffle
434
  name << (native ? "native" : "generic")
435 436

  args = [dst, src]
Brice Videau's avatar
Brice Videau committed
437
  args << target_dims if shuffle
438 439 440 441

  p = Procedure( name, args, return_type: Int ) {
    decl d, elem_size

Brice Videau's avatar
Brice Videau committed
442 443
    if native
      decl ddst, dsrc
444

Brice Videau's avatar
Brice Videau committed
445 446
      pr ddst === "(struct aml_layout_data_native *)#{dst}->data"
      pr dsrc === "(struct aml_layout_data_native *)#{src}->data"
Brice Videau's avatar
Brice Videau committed
447 448
      pr d === "#{dsrc}->ndims"
      pr assert(d > 0);
449

Brice Videau's avatar
Brice Videau committed
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
      pr elem_size === "#{dsrc}->cpitch[0]"
      pr assert(d == "#{ddst}->ndims")
      pr assert(elem_size == "#{ddst}->cpitch[0]")
      pr For(i, 0, d, operator: '<', declit: true) {
        pr assert( "#{dsrc}->dims[#{src_index[i]}] == #{ddst}->dims[#{dst_index[i]}]" )
      }

      args = []
      args += [ d ]
      args += [ target_dims ] if shuffle
      args += [ "#{ddst}->ptr", "#{ddst}->cpitch", "#{ddst}->stride",
                "#{dsrc}->ptr", "#{dsrc}->cpitch", "#{dsrc}->stride",
                "#{dsrc}->dims", elem_size ]
      pr Return(aml_copy_nd_c(stride: true, shuffle: shuffle).call(*args))
    else
      coords = Sizet :coords, dim: Dim()
      coords_out = Sizet :coords_out, dim: Dim()
      elem_number = Sizet :elem_number, dim: Dim()
468
      elem_number2 = Sizet :elem_number2, dim: Dim()
Brice Videau's avatar
Brice Videau committed
469 470 471
      decl coords
      decl coords_out if shuffle
      decl elem_number
472
      decl elem_number2
Brice Videau's avatar
Brice Videau committed
473 474 475 476 477 478 479 480

      pr assert( FuncCall( :aml_layout_ndims, dst ) == FuncCall( :aml_layout_ndims, src ) )
      pr d === FuncCall( :aml_layout_ndims, dst )
      pr assert( FuncCall( :aml_layout_element_size, dst ) == FuncCall( :aml_layout_element_size, src ) )
      pr elem_size === FuncCall( :aml_layout_element_size, dst )
      pr coords === alloca(d * sizeof("size_t")).cast(coords)
      pr coords_out === alloca(d * sizeof("size_t")).cast(coords_out) if shuffle
      pr elem_number === alloca(d * sizeof("size_t")).cast(elem_number)
481 482 483 484 485 486
      pr elem_number2 === alloca(d * sizeof("size_t")).cast(elem_number2)
      pr FuncCall( :aml_layout_adims_column, src, elem_number )
      pr FuncCall( :aml_layout_adims_column, dst, elem_number2 )
      pr For(i, 0, d, operator: '<', declit: true) {
        pr assert( "#{elem_number}[#{src_index[i]}] == #{elem_number2}[#{dst_index[i]}]" )
      }
Brice Videau's avatar
Brice Videau committed
487 488 489 490 491 492 493

      new_args = [d, dst, src, elem_number, elem_size, coords]
      new_args << coords_out << target_dims if shuffle

      pr aml_copy_layout_generic_helper(shuffle: shuffle).call(*new_args)
      pr Return(0)
    end
494 495 496
  }
end

497
def aml_copy_layout_transpose(native: true, reverse: false)
498 499 500
  dst = Pointer :dst, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :inout
  src = Pointer :src, type: CStruct::new(type_name: :aml_layout, members: {}), dir: :in

Brice Videau's avatar
Brice Videau committed
501
  dsrc = Pointer :dsrc, type: CStruct::new(type_name: :aml_layout_data_native, members: {})
502 503 504 505 506 507
  target_dims = Sizet :target_dims, dim: Dim()
  d = Sizet :d
  i = Sizet :i

  name = name_prefix + "layout_"
  name << "reverse_" if reverse
508 509
  name << "transpose_"
  name << (native ? "native" : "generic")
510 511 512
  p = Procedure( name, [ dst, src ], return_type: Int ) {
    decl d
    decl target_dims
Brice Videau's avatar
Brice Videau committed
513
    decl dsrc
514

Brice Videau's avatar
Brice Videau committed
515 516
    pr dsrc === "(struct aml_layout_data_native *)#{src}->data"
    pr d === "#{dsrc}->ndims"
517 518 519 520 521 522 523 524 525 526 527 528
    pr target_dims === alloca(d * sizeof("size_t")).cast(target_dims)
    if reverse
      pr target_dims[0] === d - 1
      pr For(i, 1, d, operator: '<', declit: true) {
        pr target_dims[i] === i - 1
      }
    else
      pr target_dims[d - 1] === 0
      pr For(i, 0, d - 1, operator: '<', declit: true) {
        pr target_dims[i] === i + 1
      }
    end
Brice Videau's avatar
Brice Videau committed
529
    pr Return( aml_copy_layout(native: native, shuffle: true).call( dst, src, target_dims) )
530 531 532 533
  }
end

pr $aml_compute_cumulative_pitch = aml_compute_cumulative_pitch
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559

generation_space = BruteForceOptimizer::new(
  OptimizationSpace::new(
    shuffle: [false, true],
    stride: [false, true]
  )
)

transpose_generation_space = BruteForceOptimizer::new(
  OptimizationSpace::new(
    stride: [false, true],
    reverse: [false, true],
    cumulative: [false, true]
  )
)

generation_space.each { |params|
  pr aml_copy_nd_helper(**params)
  pr aml_copy_nd_c(**params)
  pr aml_copy_nd(**params)
}

transpose_generation_space.each { |params|
  pr aml_copy_tnd(**params)
}

560 561 562 563
pr aml_copy_layout
pr aml_copy_layout(shuffle: true)
pr aml_copy_layout_transpose
pr aml_copy_layout_transpose(reverse: true)
564

Brice Videau's avatar
Brice Videau committed
565 566 567 568 569 570 571
pr aml_copy_layout_generic_helper(shuffle: false)
pr aml_copy_layout_generic_helper(shuffle: true)
pr aml_copy_layout(native: false)
pr aml_copy_layout(native: false, shuffle: true)
pr aml_copy_layout_transpose(native: false)
pr aml_copy_layout_transpose(native: false, reverse: true)

572 573 574 575 576
stdout0.close

Process.wait(pid1)
Process.wait(pid2)