Skip to content

Commit 98752ef

Browse files
authored
[flang][cuda] Add interface for sinpi, cospi and sincospi (#126123)
Add interface for `sinpi`, `cospi` and `sincospi` and also expose `sincosf`
1 parent 1d319df commit 98752ef

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

flang/module/cudadevice.f90

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,34 +384,82 @@ attributes(device) integer(4) function signbit(x) bind(c,name='__nv_signbitd')
384384
end function
385385
end interface
386386
public :: signbit
387-
388-
interface sincos
387+
388+
interface
389389
attributes(device) subroutine sincosf(x, y, z) bind(c,name='__nv_sincosf')
390390
real(4), value :: x
391391
real(4), device :: y
392392
real(4), device :: z
393393
end subroutine
394+
end interface
395+
public :: sincosf
396+
interface
394397
attributes(device) subroutine sincos(x, y, z) bind(c,name='__nv_sincos')
395398
real(8), value :: x
396399
real(8), device :: y
397400
real(8), device :: z
398401
end subroutine
399402
end interface
403+
interface sincos
404+
procedure :: sincosf
405+
procedure :: sincos
406+
end interface
400407
public :: sincos
401-
402-
interface sincospi
408+
409+
interface
403410
attributes(device) subroutine sincospif(x, y, z) bind(c,name='__nv_sincospif')
404411
real(4), value :: x
405412
real(4), device :: y
406413
real(4), device :: z
407414
end subroutine
415+
end interface
416+
public :: sincospif
417+
interface
408418
attributes(device) subroutine sincospi(x, y, z) bind(c,name='__nv_sincospi')
409419
real(8), value :: x
410420
real(8), device :: y
411421
real(8), device :: z
412422
end subroutine
413423
end interface
424+
interface sincospi
425+
procedure :: sincospif
426+
procedure :: sincospi
427+
end interface
414428
public :: sincospi
429+
430+
interface
431+
attributes(device) real(4) function cospif(x) bind(c,name='__nv_cospif')
432+
real(4), value :: x
433+
end function
434+
end interface
435+
public :: cospif
436+
interface
437+
attributes(device) real(8) function cospi(x) bind(c,name='__nv_cospi')
438+
real(8), value :: x
439+
end function
440+
end interface
441+
interface cospi
442+
procedure :: cospif
443+
procedure :: cospi
444+
end interface
445+
public :: cospi
446+
447+
interface
448+
attributes(device) real(4) function sinpif(x) bind(c,name='__nv_sinpif')
449+
real(4), value :: x
450+
end function
451+
end interface
452+
public :: sinpif
453+
interface
454+
attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi')
455+
real(8), value :: x
456+
end function
457+
end interface
458+
interface sinpi
459+
procedure :: sinpif
460+
procedure :: sinpi
461+
end interface
462+
public :: sinpi
415463

416464
interface mulhi
417465
attributes(device) integer function __mulhi(i,j) bind(c,name='__nv_mulhi')

0 commit comments

Comments
 (0)