<?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 internal error: bad pointer in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004291#M31475</link>
    <description>&lt;P&gt;my code is this:&lt;/P&gt;

&lt;P&gt;__________________________________________&lt;/P&gt;

&lt;P&gt;#include &amp;lt;iostream&amp;gt;&lt;/P&gt;

&lt;P&gt;class TEST{&lt;BR /&gt;
	public:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; double *A;&lt;BR /&gt;
	public:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; TEST(double * _A){&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A = _A;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; void run(){&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A[1] = 0;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // double *B = A;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload target (mic) nocopy(this : alloc_if(1) free_if(0)) out(A:length(2*3) alloc_if(0) free_if(1))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A[1] = 1;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	};&lt;/P&gt;

&lt;P&gt;int main()&lt;BR /&gt;
	{&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; double *A = (double*)_mm_malloc(sizeof(double)*2*3,64);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; TEST test(A);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; test.run();&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;______________________________________________________&lt;/P&gt;

&lt;P&gt;I want to copy the matrix A in TEST constructor first,and then in run() using it.but it give me some error when I compile the code&lt;/P&gt;

&lt;P&gt;------------------------------------------------------------&lt;/P&gt;

&lt;P&gt;$ icpc testclass.cpp&lt;/P&gt;

&lt;P&gt;testclass.cpp(9): internal error: bad pointer&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^&lt;/P&gt;

&lt;P&gt;compilation aborted for testclass.cpp (code 4)&lt;/P&gt;

&lt;P&gt;--------------------------------------------------------------&lt;/P&gt;

&lt;P&gt;could someone help me figure out what wrong with this ,thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2015 12:59:53 GMT</pubDate>
    <dc:creator>yongbei_ma_</dc:creator>
    <dc:date>2015-04-01T12:59:53Z</dc:date>
    <item>
      <title>internal error: bad pointer</title>
      <link>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004291#M31475</link>
      <description>&lt;P&gt;my code is this:&lt;/P&gt;

&lt;P&gt;__________________________________________&lt;/P&gt;

&lt;P&gt;#include &amp;lt;iostream&amp;gt;&lt;/P&gt;

&lt;P&gt;class TEST{&lt;BR /&gt;
	public:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; double *A;&lt;BR /&gt;
	public:&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; TEST(double * _A){&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A = _A;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; void run(){&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A[1] = 0;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // double *B = A;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload target (mic) nocopy(this : alloc_if(1) free_if(0)) out(A:length(2*3) alloc_if(0) free_if(1))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A[1] = 1;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	};&lt;/P&gt;

&lt;P&gt;int main()&lt;BR /&gt;
	{&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; double *A = (double*)_mm_malloc(sizeof(double)*2*3,64);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; TEST test(A);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; test.run();&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;______________________________________________________&lt;/P&gt;

&lt;P&gt;I want to copy the matrix A in TEST constructor first,and then in run() using it.but it give me some error when I compile the code&lt;/P&gt;

&lt;P&gt;------------------------------------------------------------&lt;/P&gt;

&lt;P&gt;$ icpc testclass.cpp&lt;/P&gt;

&lt;P&gt;testclass.cpp(9): internal error: bad pointer&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^&lt;/P&gt;

&lt;P&gt;compilation aborted for testclass.cpp (code 4)&lt;/P&gt;

&lt;P&gt;--------------------------------------------------------------&lt;/P&gt;

&lt;P&gt;could someone help me figure out what wrong with this ,thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:59:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004291#M31475</guid>
      <dc:creator>yongbei_ma_</dc:creator>
      <dc:date>2015-04-01T12:59:53Z</dc:date>
    </item>
    <item>
      <title>I will try reproducing the</title>
      <link>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004292#M31476</link>
      <description>&lt;P&gt;I will try reproducing the error and post again when I know more.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 17:01:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004292#M31476</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-04-01T17:01:16Z</dc:date>
    </item>
    <item>
      <title>I reproduced the internal</title>
      <link>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004293#M31477</link>
      <description>&lt;P&gt;&lt;STRONG&gt;NOTE: This post was Updated after my original post.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I reproduced the internal error and forwarded it to Development (see internal tracking id below).&lt;/P&gt;

&lt;P&gt;After checking with Developers much more knowledgeable than me with C++ and offloading a CLASS member pointer, I removed my earlier code and provided their corrected code below. Unfortunately their variant is still similar to your code and still suffers the internal error with the &lt;STRONG&gt;Parallel Studio XE 2015 Update 2&lt;/STRONG&gt;. I have verified there is a fix in our latest internal development compiler but I need to check whether it will make the upcoming &lt;STRONG&gt;Parallel Studio XE 2015 Update 3&lt;/STRONG&gt; release.&lt;/P&gt;

&lt;P&gt;(Internal tracking id: DPD200368511)&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

class TEST{
public:
    double *A;
public:
    TEST(double * _A){
        A = _A;

//      #pragma offload_transfer target(mic:0) nocopy(this : alloc_if(1) free_if(0)) in(A:length(2*3) alloc_if(1) free_if(0))

	// Allocate the object
        #pragma offload_transfer target(mic:0) nocopy(this: alloc_if(1))
	// Use existing object, and allocate A in it
        #pragma offload_transfer target(mic:0) nocopy(this) in(A:length(2*3) alloc_if(1) free_if(0))

    }
    void run(){
        A[1] = 0;
        // double *B = A;
        std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;

//       #pragma offload target (mic) nocopy(this : alloc_if(1) free_if(0)) out(A:length(2*3) alloc_if(0) free_if(1))

	// Refresh "this" pointer in this offload
        #pragma offload target (mic) in(this: length(0) alloc_if(0) free_if(0) ) out(A:length(2*3) alloc_if(0) free_if(1))

        {
            A[1] = 1;
        }
        std::cout&amp;lt;&amp;lt;A[1]&amp;lt;&amp;lt;std::endl;
    }
};

int main()
{
    double *A = (double*)_mm_malloc(sizeof(double)*2*3,64);
    TEST test(A);
    test.run();
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004293#M31477</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-04-01T19:22:00Z</dc:date>
    </item>
    <item>
      <title>The internal error is fixed</title>
      <link>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004294#M31478</link>
      <description>&lt;P&gt;The internal error is fixed in PSXE 2015 update #3, so I'm closing this ticket now.&lt;/P&gt;

&lt;P&gt;Patrick (covering for Kevin)&lt;/P&gt;

&lt;P&gt;C:\Users\pbkenned\ISN\U544988&amp;gt;icl U544988.cpp -GR-&lt;BR /&gt;
	Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.3.208 Build 20150407&lt;BR /&gt;
	Copyright (C) 1985-2015 Intel Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;U544988.cpp&lt;BR /&gt;
	Microsoft (R) Incremental Linker Version 12.00.31101.0&lt;BR /&gt;
	Copyright (C) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;-out:U544988.exe&lt;BR /&gt;
	U544988.obj&lt;BR /&gt;
	C:\Users\pbkenned\AppData\Local\Temp\5\6884173.obj&lt;BR /&gt;
	-defaultlib:liboffload&lt;BR /&gt;
	-defaultlib:libiomp5md&lt;BR /&gt;
	ofldbegin.obj&lt;BR /&gt;
	ofldend.obj&lt;/P&gt;

&lt;P&gt;C:\Users\pbkenned\ISN\U544988&amp;gt;U544988.exe&lt;BR /&gt;
	0&lt;BR /&gt;
	1&lt;/P&gt;

&lt;P&gt;C:\Users\pbkenned\ISN\U544988&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 14:48:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/internal-error-bad-pointer/m-p/1004294#M31478</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2015-04-28T14:48:09Z</dc:date>
    </item>
  </channel>
</rss>

