<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Rajiv, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096689#M67160</link>
    <description>&lt;P&gt;Hi Rajiv,&lt;/P&gt;

&lt;P&gt;I see. Thank you very much.&lt;/P&gt;

&lt;P&gt;Bobo&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 03:34:28 GMT</pubDate>
    <dc:creator>Bobo_S_</dc:creator>
    <dc:date>2016-01-21T03:34:28Z</dc:date>
    <item>
      <title>using dgemm causes offload error</title>
      <link>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096687#M67158</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Why I am getting error when I use dgemm inside offload section?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      PROGRAM   MAIN
      IMPLICIT NONE

      DOUBLE PRECISION ALPHA, BETA
      INTEGER          I, J
      INTEGER           M,K,N
      PARAMETER        (N=10)
      DOUBLE PRECISION, allocatable:: A(:), B(:)
      DOUBLE PRECISION, allocatable:: C(:)

      allocate(A(N*N*4), B(4*N*N), C(4*N*N))

      ALPHA=1.0d0
      BETA=1.0d0
      DO I = 1, N*2
         DO J = 1, N*2
            A(10*(I-1) + J) = 0.1*(I+J)
            B(10*(I-1) + J) = 0.1*(I+J)
            C(10*(I-1) + J) = 0.1*(I+J)
         END DO
      END DO
      call mydgemm_offload(2, A, B, C, ALPHA, BETA)

      STOP

      END

      SUBROUTINE mydgemm_offload(n, a, b, c, alpha, beta)
      INTEGER n
      DOUBLE PRECISION a(*), b(*), c(*)
      target a, b
      DOUBLE PRECISION alpha, beta
      DOUBLE PRECISION, pointer :: pa(:), pb(:)
C      !dir$ attributes offload:mic :: a, b, c
      !dir$ attributes offload:mic :: DGEMM
      pa=&amp;gt;a(2:2+n*n-1)
      pb=&amp;gt;b(2:2+n*n-1)

      !dir$ offload_transfer target(mic) in(c:length(100)
     &amp;amp;     alloc_if(.TRUE.) free_if(.FALSE.))
      !dir$ offload_transfer target(mic) in(pa:length(n*n)
     &amp;amp;     alloc_if(.TRUE.) free_if(.FALSE.))
      !dir$ offload_transfer target(mic) in(pb:length(n*n)
     &amp;amp;     alloc_if(.TRUE.) free_if(.FALSE.))

      !dir$ offload begin target(mic) nocopy(pa:length(n*n)) nocopy(pb:
     &amp;amp;     length(n*n)) nocopy(c(1:100))
      write(*,*) "before dgemm: c:"
      write(*,*) c(1:10)
      write(*,*) "pa:", pa
      write(*,*) "pb:", pb
      call DGEMM('N','T', n, n, n, alpha, pa, n, pb, n, beta, c(3), n)
      write(*,*) "after dgemm: c:"
      write(*,*) c(1:10)
      write(*,*) "pa:", pa
      write(*,*) "pb:", pb
      write(*,*) "bobo1:"
      !dir$ end offload

      write(*,*) "before out(c): c:"
      write(*,*) c(3:n*n+2)
      !dir$ offload_transfer target(mic) out(c:length(100)
     &amp;amp;     alloc_if(.FALSE.) free_if(.TRUE.))
      write(*,*) "after out(c): c:"
      write(*,*) c(3:n*n+2)

      RETURN
      END&lt;/PRE&gt;

&lt;P&gt;ifort -mkl dgemm_example-offload-5.f&lt;/P&gt;

&lt;P&gt;./a.out&lt;/P&gt;

&lt;P&gt;&amp;nbsp;before dgemm: c:&lt;BR /&gt;
	&amp;nbsp; 0.200000002980232 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.400000005960464&lt;BR /&gt;
	&amp;nbsp; 0.500000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.600000023841858 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.699999988079071&lt;BR /&gt;
	&amp;nbsp; 0.800000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.900000035762787 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.00000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;1.10000002384186&lt;BR /&gt;
	&amp;nbsp;pa: &amp;nbsp;0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.400000005960464 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.500000000000000&lt;BR /&gt;
	&amp;nbsp; 0.600000023841858&lt;BR /&gt;
	&amp;nbsp;pb: &amp;nbsp;0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.400000005960464 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.500000000000000&lt;BR /&gt;
	&amp;nbsp; 0.600000023841858&lt;BR /&gt;
	&amp;nbsp;after dgemm: c:&lt;BR /&gt;
	&amp;nbsp; 0.200000002980232 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.740000013113022&lt;BR /&gt;
	&amp;nbsp; 0.920000018477440 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.02000004231930 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.22000002145767&lt;BR /&gt;
	&amp;nbsp; 0.800000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.900000035762787 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.00000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;1.10000002384186&lt;BR /&gt;
	&amp;nbsp;pa: &amp;nbsp;0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.400000005960464 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.500000000000000&lt;BR /&gt;
	&amp;nbsp; 0.600000023841858&lt;BR /&gt;
	&amp;nbsp;pb: &amp;nbsp;0.300000011920929 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.400000005960464 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.500000000000000&lt;BR /&gt;
	&amp;nbsp; 0.600000023841858&lt;BR /&gt;
	&amp;nbsp;bobo1:&lt;BR /&gt;
	offload error: process on the device 0 unexpectedly exited with code 0&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;The thing is if I do not use DGEMM inside the offload section, the code works fine. But when there is DGEMM, I got offload error.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Anybody can help? Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 20:55:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096687#M67158</guid>
      <dc:creator>Bobo_S_</dc:creator>
      <dc:date>2016-01-20T20:55:25Z</dc:date>
    </item>
    <item>
      <title>Add a in(n) clause to the</title>
      <link>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096688#M67159</link>
      <description>&lt;P&gt;Add a in(n) clause to the offload on line 46.&lt;/P&gt;

&lt;P&gt;When you call dgemm, the variables alpha, beta and n are referenced in the code and by default become inout.&lt;/P&gt;

&lt;P&gt;Alpha and beta are variables passed as parameters, and can be dealt with. "n" is a parameter, in other words, a constant. When a write operation is attempted on it you get an error. The write is caused by the default inout of n.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 22:34:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096688#M67159</guid>
      <dc:creator>Rajiv_D_Intel</dc:creator>
      <dc:date>2016-01-20T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Hi Rajiv,</title>
      <link>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096689#M67160</link>
      <description>&lt;P&gt;Hi Rajiv,&lt;/P&gt;

&lt;P&gt;I see. Thank you very much.&lt;/P&gt;

&lt;P&gt;Bobo&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 03:34:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/using-dgemm-causes-offload-error/m-p/1096689#M67160</guid>
      <dc:creator>Bobo_S_</dc:creator>
      <dc:date>2016-01-21T03:34:28Z</dc:date>
    </item>
  </channel>
</rss>

