none
how to judge the two accelerator_view are equal? RRS feed

  • 常规讨论

  • Hi all:

    I am interesting about the c++amp.
    I just use write a test according to the test suit.

    the case is 5_Data_Cont/5_1_array/5_1_3_m/Properties/associated_accvl_view/Test.03/test.cpp
    but I found that 

     accelerator_view gpu_av = _gpu_device.create_view(queuing_mode_immediate);
            accelerator_view cpu_av = _cpu_device.create_view(queuing_mode_immediate);
    
            array<int, _rank> src(e1, gpu_av, cpu_av);
            if (src.get_associated_accelerator_view() == src.get_accelerator_view()) {
                passed = runall_pass;
    }
            



    I am not understand why get_associated_accelerator_view is equal to src get_accelerator_view() ?
    according to the cppampOpenSpecificationv12.pdf, I think in fact they compare two accelerator_view, but the two accelerator_view are create by the device. which mean the accelerator are not equal. 
    or may be the comparation between accelerator_view compare the attributes except the acclelerator?

    Thank,

    Candy 
    in China
    2014年4月1日 3:16

全部回复

  • Hi,

    According to your description, I think it depends on how the comparison operator overloading implement.

    As far as I know, array::get_associated_accelerator_view Method gets the second accelerator_view object that is passed as a parameter when a staging constructor is called to instantiate the  array object. array::get_accelerator_view Method returns the accelerator_view object that represents the location where the array object is allocated. This property can be accessed only on the CPU.

    They all return accelerator_view object, which represents a virtual device abstraction on a C++ AMP data-parallel accelerator.

    accelerator_view Class provides accelerator_view::operator== Operator to compares this accelerator_view object with another and returns true if they are the same; otherwise, returns false. As to how they compare and which attributes they compare, it really depends on its implementation.

    May

                                                       

    .


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年4月2日 6:04
  • Thanks for your reply.
    but I still have some details not clear.
    I find the case of "5_Data_Cont/5_1_array/5_1_3_m/Properties/associated_accvl_view/Test.03/test.cpp"
    the case not passed.
    I compare the two cases:
    [1] 5_Data_Cont/5_1_array/5_1_3_m/Properties/associated_accvl_view/Test.02/test.cpp

    [2] 5_Data_Cont/5_1_array/5_1_3_m/Properties/associated_accvl_view/Test.03/test.cpp
    the different is:
    for [1]:
            array<int, _rank> src(e1, cpu_av, gpu_av);
            if (src.get_associated_accelerator_view() != src.get_accelerator_view())
    for [2]:
            array<int, _rank> src(e1, gpu_av, cpu_av);
            if (src.get_associated_accelerator_view() == src.get_accelerator_view())
    I find the defination about the array:
    array(const Concurrency::extent<N>& extent, accelerator_view av, accelerator_view associated_av)
    for av: An accelerator_view object which specifies the home location of this array.
    for associated_av:
    An accelerator_view object which specifies a target device accelerator.

    but I not sure the internal mechanism about this, I have some a top about this.
    if anyone have some suggestion, please tell me why these are different.

    Thank,

    Candy
    in China

    2014年4月4日 9:35
  • Hi,

    Sorry to reply so late because I have some holidays those days. Based on your further question, actually I am also not familar with the internal mechanism, in order to keep this issue thread open and let other members who knows this well can join this topic at any time, I help you change the thread type to general discussion.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年4月14日 8:45