moskewcz / boda

Boda: A C++ Framework for Efficient Experiments in Computer Vision
Other
63 stars 12 forks source link

NESI default arguments for rtc_compute #24

Open dinhv opened 7 years ago

dinhv commented 7 years ago

I've added a new variable in rtc_compute_t: uint32_t use_device_no; //NESI(default=0,help="device number of OpenCL device to use")

With this variable, a user can choose which device to use if multiple ones are available. However when I run my testing mode


struct auto_tuner_tester_t : virtual public nesi, public has_main_t // NESI(help="get OpenCL/CUDA device informations",
    // bases=["has_main_t"], type_id="device_information" )
  {
      p_rtc_compute_t rtc;
      rtc_device_info_t dev_info;

    virtual cinfo_t const * get_cinfo( void ) const; // required declaration for NESI support

    virtual void main(nesi_init_arg_t * nia) {
      rtc = make_p_rtc_compute_t_init_and_check_unused_from_lexp( parse_lexp( "(be=ocl)" ), nia );
      rtc->init();

      dev_info = rtc->get_device_info();
      printf("%s %d %d\n", dev_info.device_name.c_str(), dev_info.wg_sz, dev_info.mem_sz);
    }
  };

with ./boda device_information --use_device_no=0, Boda throws an error: error: unused input: use_device_no:0

So how do I have to set this variable in my input, or is it simply a bug?

moskewcz commented 7 years ago

If you point me to a branch where I can run your test I'll take a look.

On Aug 7, 2017 5:40 AM, "dinhv" notifications@github.com wrote:

I've added a new variable in rtc_compute_t: uint32_t use_device_no; //NESI(default=0,help="device number of OpenCL device to use")

With this variable, a user can choose which device to use if multiple ones are available. However when I run my testing mode

struct auto_tuner_tester_t : virtual public nesi, public has_main_t // NESI(help="get OpenCL/CUDA device informations", // bases=["has_main_t"], type_id="device_information" ) { p_rtc_compute_t rtc; rtc_device_info_t dev_info;

virtual cinfo_t const * get_cinfo( void ) const; // required declaration for NESI support

virtual void main(nesi_init_arg_t * nia) {
  rtc = make_p_rtc_compute_t_init_and_check_unused_from_lexp( parse_lexp( "(be=ocl)" ), nia );
  rtc->init();

  dev_info = rtc->get_device_info();
  printf("%s %d %d\n", dev_info.device_name.c_str(), dev_info.wg_sz, dev_info.mem_sz);
}

};

with ./boda device_information --use_device_no=0, Boda throws an error: error: unused input: use_device_no:0

So how do I have to set this variable in my input, or is it simply a bug?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moskewcz/boda/issues/24, or mute the thread https://github.com/notifications/unsubscribe-auth/AGL-s0nhExZmVkyKXjBA3AJbrjChbEbOks5sVwXVgaJpZM4OvYdw .

moskewcz commented 7 years ago

looking at this in more detail, i think i see what's happening, and i can give some additional information: